Created
March 1, 2014 21:54
-
-
Save rodericj/9298079 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RKObjectManager* objectManager = [RKObjectManager managerWithBaseURL:[NSURL URLWithString:@"https://api.foursquare.com/"]]; | |
objectManager.managedObjectStore = [self managedObjectStore]; | |
RKEntityMapping* listMapping = [RKEntityMapping mappingForEntityForName:[FOFSList entityName] inManagedObjectStore:objectManager.managedObjectStore]; | |
[listMapping addAttributeMappingsFromDictionary:@{ | |
@"id": @"listID", | |
@"title": @"name", | |
@"description": @"desc", | |
@"user": @"user", | |
@"following": @"following", | |
// @"editable": @"editable", | |
@"collaborative": @"collaborative", | |
@"canonicalUrl": @"canonicalUrl", | |
@"venueCount": @"venueCount", | |
@"visitedCount": @"visitedCount" | |
}]; | |
RKResponseDescriptor * responseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:listMapping | |
method:RKRequestMethodGET pathPattern:nil keyPath:@"response.lists.groups" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)]; | |
[objectManager addResponseDescriptor:responseDescriptor]; | |
listMapping.identificationAttributes = @[ @"listID" ]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment