Created
March 26, 2012 17:18
-
-
Save mikeabdullah/2206650 to your computer and use it in GitHub Desktop.
Unsafe cross-thread passing of an error
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
- (BOOL)saveAndReturnError:(NSError **)error | |
{ | |
NSManagedObjectContext *context = [self managedObjectContext]; | |
__block BOOL result; | |
[context performBlockAndWait:^{ | |
result = [context save:error]; | |
}]; | |
return result; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment