Merge pull request #202 from jwie/fix_unit_test

[NSManagedObjectContext MR_saveInBackgroundErrorHandler:completion:]
This commit is contained in:
Saul Mora
2012-07-08 12:17:00 -07:00

View File

@@ -98,7 +98,7 @@
- (void) MR_saveInBackgroundErrorHandler:(void (^)(NSError *))errorCallback completion:(void (^)(void))completion;
{
[self performBlock:^{
[self performBlockAndWait:^{
[self MR_saveWithErrorCallback:errorCallback];
if (self == [[self class] MR_defaultContext])
@@ -106,7 +106,7 @@
[[[self class] MR_rootSavingContext] MR_saveInBackgroundErrorHandler:errorCallback completion:completion];
}
if (self == [[self class] MR_rootSavingContext])
if (completion && self == [[self class] MR_rootSavingContext])
{
dispatch_async(dispatch_get_main_queue(), completion);
}