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.

If you enjoy my content, please consider supporting me on Ko-fi. In return you can browse this whole site without any pesky ads! More details here.

Leave a Comment!

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