Created
October 21, 2011 12:37
-
-
Save blakewatters/1303723 to your computer and use it in GitHub Desktop.
Performing RestKit Mapping Operation Manually
This file contains 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
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