mirror of
https://github.com/zhigang1992/MagicalRecord.git
synced 2026-01-12 22:48:38 +08:00
Minor formatting updates
This commit is contained in:
@@ -42,7 +42,7 @@ static NSString * const kMagicalRecordNSManagedObjectContextWorkingName = @"kNSM
|
||||
|
||||
- (NSString *) MR_parentChain;
|
||||
{
|
||||
NSMutableString *familyTree = [@"" mutableCopy];
|
||||
NSMutableString *familyTree = [@"\n" mutableCopy];
|
||||
NSManagedObjectContext *currentContext = self;
|
||||
do
|
||||
{
|
||||
@@ -131,7 +131,7 @@ static NSString * const kMagicalRecordNSManagedObjectContextWorkingName = @"kNSM
|
||||
NSManagedObjectContext *defaultContext = [self MR_newMainQueueContext];
|
||||
[self MR_setDefaultContext:defaultContext];
|
||||
|
||||
[defaultContext setParentContext:rootSavingContext];
|
||||
[defaultContext setParentContext:rootContext];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -182,7 +182,7 @@ static NSString * const kMagicalRecordNSManagedObjectContextWorkingName = @"kNSM
|
||||
[context setPersistentStoreCoordinator:coordinator];
|
||||
}];
|
||||
|
||||
MRLog(@"-> Created %@", [context MR_description]);
|
||||
MRLog(@"-> Created Context %@", [context MR_workingName]);
|
||||
}
|
||||
return context;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
{
|
||||
if (![self hasChanges])
|
||||
{
|
||||
MRLog(@"NO CHANGES IN CONTEXT %@ - NOT SAVING", [self MR_description]);
|
||||
MRLog(@"NO CHANGES IN ** %@ ** CONTEXT - NOT SAVING", [self MR_workingName]);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -72,16 +72,15 @@
|
||||
{
|
||||
[self performBlock:^{
|
||||
[self MR_saveWithErrorCallback:errorCallback];
|
||||
if (self.parentContext) {
|
||||
if ([self parentContext])
|
||||
{
|
||||
[[self parentContext] performBlock:^{
|
||||
[[self parentContext] MR_saveNestedContextsErrorHandler:errorCallback completion:completion];
|
||||
}];
|
||||
} else {
|
||||
if (completion) {
|
||||
dispatch_async(dispatch_get_main_queue(), ^{
|
||||
completion();
|
||||
});
|
||||
}
|
||||
else if (completion)
|
||||
{
|
||||
dispatch_async(dispatch_get_main_queue(), completion);
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user