Skip to content

Instantly share code, notes, and snippets.

@mikeabdullah
Created March 26, 2012 17:18
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 mikeabdullah/2206650 to your computer and use it in GitHub Desktop.
Save mikeabdullah/2206650 to your computer and use it in GitHub Desktop.
Unsafe cross-thread passing of an error
- (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