Created
July 23, 2014 16:19
-
-
Save quellish/1e09834a9ff0ec95a34d to your computer and use it in GitHub Desktop.
recursive context save
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(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