mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-01-12 17:32:18 +08:00
Merge pull request #202 from jwie/fix_unit_test
[NSManagedObjectContext MR_saveInBackgroundErrorHandler:completion:]
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user