Note that there are some explanatory texts on larger screens.

plurals
  1. PORestKit 0.2 — Error Domain=org.restkit.RestKit.ErrorDomain Code=1001
    primarykey
    data
    text
    <p>I just updated to RestKit 0.20 and I'm beating my head against my desk top trying to figure what why my Album object won't map. The response object doesn't have a keyPath — but setting it to @"" worked before.</p> <p>Here is a snippet of the data coming back:</p> <pre><code>[ { id: "337", title: "Hockey", description: "", location: "", date_created: "1353424563", date_modified: "1353424563", featured_image: "album_default.png", featured_thumb_link: "http://test1.keepsayk.com//images/album_default.jpg", featured_main_link: "http://test1.keepsayk.com/img/album_default.png", feat_img_type: "image", public: "0", default_album: "", owner_fname: "Mike", owner_lname: "Rose", owner_id: "102", recent_media: false, last_media_added_date: false, tags: [ ], circles: [], media: [ ], image_count: 0, video_count: 0, text_count: 0, audio_count: 0, comments: [ ], scrapbook: [ ] }, { id: "336", title: "Bull", description: "", location: "", date_created: "1353420585", date_modified: "1353420585", featured_image: "album_default.png", featured_thumb_link: "http://test1.keepsayk.com//images/album_default.jpg", featured_main_link: "http://test1.keepsayk.com/img/album_default.png", feat_img_type: "image", public: "0", default_album: "", owner_fname: "Mike", owner_lname: "Rose", owner_id: "102", recent_media: false, last_media_added_date: false, tags: [ ], circles: [], media: [ ], image_count: 0, video_count: 0, text_count: 0, audio_count: 0, comments: [ ], scrapbook: [ ] }, ... ] </code></pre> <p>Here is my code in the App Delegate:</p> <pre><code>// restkit object manager _objectManager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:@"http://test1.keepsayk.com"]]; [AFNetworkActivityIndicatorManager sharedManager].enabled = YES; // restkit object store _objectManager.managedObjectStore = [[RKManagedObjectStore alloc] initWithManagedObjectModel:[self managedObjectModel]]; [_objectManager.managedObjectStore createPersistentStoreCoordinator]; [_objectManager.managedObjectStore createManagedObjectContexts]; // setup album object RKEntityMapping *albumEntityMapping = [RKEntityMapping mappingForEntityForName:@"KeepsaykAlbum" inManagedObjectStore:_objectManager.managedObjectStore]; albumEntityMapping.identificationAttributes = @[@"identifier"]; [albumEntityMapping addAttributeMappingsFromDictionary:@{ @"id" : @"identifier", @"title" : @"keepsaykTitle", @"description" : @"keepsaykDescription", @"date_created" : @"dateCreated", @"date_modified" : @"dateModified", @"featured_thumb_link" : @"featuredImageThumbLink", @"featured_main_link" : @"featuredImageLink", @"public" : @"isPublic", @"default_album" : @"isDefaultAlbum", @"owner_fname" : @"ownerFirstName", @"owner_lname" : @"ownerLastName", @"owner_id" : @"ownerIdentifier", @"last_media_added_date" : @"dateMediaModified", @"image_count" : @"imageCount", @"video_count" : @"videoCount", @"text_count" : @"textCount", @"audio_count" : @"audioCount", @"scrapbook" : @"scrapbookLayouts" }]; [_objectManager addResponseDescriptor:[RKResponseDescriptor responseDescriptorWithMapping:albumEntityMapping pathPattern:@"albums/display/:userID/:apiKey" keyPath:@"" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]]; </code></pre> <p>I call the get method in another class — the resource path is traced in the log:</p> <pre><code>- (void)loadObjectsFromResourcePath:(NSString *)resourcePath; { NSLog(@"resource path: %@", resourcePath); [RKObjectManager.sharedManager getObjectsAtPath:resourcePath parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) { NSLog(@"mapping result: %@", [mappingResult array]); [self stopLoading]; } failure:^(RKObjectRequestOperation *operation, NSError *error) { NSLog(@"error: %@", error); [self stopLoading]; }]; } </code></pre> <p>Here is my error log:</p> <pre><code> 2012-12-04 17:48:47.437 Keepsayk Alpha[9036:907] I restkit:RKLog.m:34 RestKit logging initialized... 2012-12-04 17:48:47.703 Keepsayk Alpha[9036:907] I restkit.support:RKMIMETypeSerialization.m:115 JSON Serialization class 'RKNSJSONSerialization' detected: Registering for MIME Type 'application/json 2012-12-04 17:48:47.696 Keepsayk Alpha[9036:907] resource path: albums/display/102/drrrbSAt6RFLsgHaKiiB6kBIyYRyzxLYinL84Kba 2012-12-04 17:48:47.708 Keepsayk Alpha[9036:1603] I restkit.network:RKHTTPRequestOperation.m:141 GET 'http://test1.keepsayk.com/albums/display/102/drrrbSAt6RFLsgHaKiiB6kBIyYRyzxLYinL84Kba' 2012-12-04 17:48:47.711 Keepsayk Alpha[9036:907] error (null), (null) 2012-12-04 17:48:48.995 Keepsayk Alpha[9036:372f] I restkit.network:RKHTTPRequestOperation.m:158 GET 'http://test1.keepsayk.com/albums/display/102/drrrbSAt6RFLsgHaKiiB6kBIyYRyzxLYinL84Kba' (200) 2012-12-04 17:48:49.011 Keepsayk Alpha[9036:907] error: Error Domain=org.restkit.RestKit.ErrorDomain Code=1001 "Unable to find any mappings for the given content" UserInfo=0x1d5b7e40 {DetailedErrors=( ), NSLocalizedDescription=Unable to find any mappings for the givn content, keyPath=null} </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload