Skip to content

Instantly share code, notes, and snippets.

@thetron
Created September 8, 2011 09:02
Show Gist options
  • Save thetron/1202980 to your computer and use it in GitHub Desktop.
Save thetron/1202980 to your computer and use it in GitHub Desktop.
NSManagedObjectContext *managedObjectContext = ((SGWMAppDelegate *)[UIApplication sharedApplication].delegate).managedObjectContext;
NSPersistentStoreCoordinator *persistentStoreCoordinator = ((SGWMAppDelegate *)[UIApplication sharedApplication].delegate).persistentStoreCoordinator;
[persistentStoreCoordinator lock];
[managedObjectContext save:&error];
[persistentStoreCoordinator unlock];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment