Skip to content

Instantly share code, notes, and snippets.

@quellish
Created September 21, 2014 08:47
Show Gist options
  • Save quellish/6e97b1119982787a12af to your computer and use it in GitHub Desktop.
Save quellish/6e97b1119982787a12af to your computer and use it in GitHub Desktop.
Assigning JSON values to a Core Data Managed Object
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