Skip to content

Instantly share code, notes, and snippets.

@blakewatters
Created October 21, 2011 12:37
Show Gist options
  • Save blakewatters/1303723 to your computer and use it in GitHub Desktop.
Save blakewatters/1303723 to your computer and use it in GitHub Desktop.
Performing RestKit Mapping Operation Manually
id<RKParser> parser = [[RKParserRegistry sharedRegistry] parserForMIMEType:RKMIMETypeJSON];
NSError *error = nil;
id parsedObject = [parser objectFromString:JSON error:&error];
if (parsedObject) {
NSManagedObject *destinationObject = // init or fetch your target object
RKObjectMappingOperation *operation = [RKObjectMappingOperation mappingOperationFromObject:parsedObject toObject:destinationObject withMapping:yourObjectMapping];
BOOL success = [operation performMapping:&error];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment