How to “quick save” in Core Data

- by

The easiest way to access a readily available save method is by importing AppDelegate into the class that wants to execute the save. Then we call a method in AppDelegate:

AppDelegate *myAppDelegate = (AppDelegate *)[[UIApplication sharedApplication]delegate];
[myAppDelegate saveContext];

No reference to fetchedResultsController or managedObjectContext or any complex &error statements.

Add your voice!

This site uses Akismet to reduce spam. Learn how your comment data is processed.