Friday, 15 August 2014

ios - Restkit getting different data for two table view controllers -



ios - Restkit getting different data for two table view controllers -

with restkit i'm trying info 2 tables view (inbox, sent), tables view controller identical in functionality, except refer different web api. in each table view controller configure , initialize restkit , makes request getting inbox or sent data, according table works great, has specific table, initialized first, error occurs

e restkit.network:rkobjectrequestoperation.m:213 'http://myhost/sent/' (200 ok / 0 objects) [request=0.9469s mapping=0.0000s total=0.9963s]: error domain=org.restkit.restkit.errordomain code=1001 "no response descriptors match response loaded." userinfo=0x11001a040 {nslocalizedfailurereason=a 200 response loaded url 'http://myhost/sent/', failed match (0) response descriptors:, nserrorfailingurlstringkey=http://myhost/sent/, nserrorfailingurlkey=http://myhost/sent/, nsunderlyingerror=0x11007f790 "no mappable object representations found @ key paths searched.", keypath=null, nslocalizeddescription=no response descriptors match response loaded. configure restkit in code:

// initialize restkit rkobjectmanager *objectmanager = [[rkobjectmanager alloc] initwithhttpclient:client]; nsmanagedobjectmodel *managedobjectmodel = [nsmanagedobjectmodel mergedmodelfrombundles:nil]; rkmanagedobjectstore *managedobjectstore = [[rkmanagedobjectstore alloc] initwithmanagedobjectmodel:managedobjectmodel]; objectmanager.managedobjectstore = managedobjectstore; rkentitymapping *sentmapping = [rkentitymapping mappingforentityforname:@"sent" inmanagedobjectstore:managedobjectstore]; sentmapping .identificationattributes = @[ @"message_id" ]; [sentmapping addattributemappingsfromdictionary:@{ @"objectid":@"message_id", @"tousername":@"email_to", @"createdat":@"date_send", @"read":@"read" }]; rkresponsedescriptor *responsedescriptor = [rkresponsedescriptor responsedescriptorwithmapping:sentmapping method:rkrequestmethodget pathpattern:@"/sent/" keypath:@"results" statuscodes:[nsindexset indexsetwithindex:200]]; [objectmanager addresponsedescriptor:responsedescriptor];

what doing wrong?

which failed match (0) response descriptors

you haven't configured response descriptors, or @ to the lowest degree none match request url path pattern (presumably sent/) , method (get).

check descriptor registrations , filtering criteria (path pattern, method , key path).

ios objective-c restkit

No comments:

Post a Comment