Created
September 21, 2014 08:47
-
-
Save quellish/6e97b1119982787a12af to your computer and use it in GitHub Desktop.
Assigning JSON values to a Core Data Managed Object
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
NSEntityDescription *entityDescription = nil; | |
NSArray *attributeNames = nil; | |
NSDictionary *mappedValues = nil; | |
entityDescription = [managedObject entity]; | |
attributeNames = [[entity attributesByName] allKeys]; | |
mappedValues = [jsonObject dictionaryWithValuesForKeys:attributeKeys]; | |
[managedObject setValuesForKeysWithDictionary:mappedValues]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment