Skip to content

Instantly share code, notes, and snippets.

@quellish
Created July 23, 2014 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quellish/1e09834a9ff0ec95a34d to your computer and use it in GitHub Desktop.
Save quellish/1e09834a9ff0ec95a34d to your computer and use it in GitHub Desktop.
recursive context save
-(void) recursiveSave:(NSManagedObjectContext *)context {
NSError *error = nil;
[context performBlock:{
if (![context save:&error]){
[self errorHandler:error];
} else {
[self recursiveSave:[context parentContext]];
}
}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment