Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Gott some info from the server
- NSMutableArray *serverContacts
- for(NSDictionary *jsonContact in contactsFromServer){
- Contact *myContact = [Method to convert jsonContact to a "Contact" object];
- [serverContacts addObject: myContact];
- }
- NSFetchRequest *blabla;
- NSArray *results = // execute request, returns an array of "Contact" objects as well
- for(Contact *contact in results){
- contact.firstName = "blablabla"; // Update some field
- }
- [managedObjectContext save]; // Save context, would save the updates, but also insert all of the objects from the "serverContacts" array which I just wanted as regular objects for reference and never wanted to insert them.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement