Fix crashes during test suite execution due to delay during processing of NSManagedObjectContextDidSaveNotification

This commit is contained in:
Blake Watters
2012-08-07 16:59:19 -04:00
parent 99738db1cc
commit 6cc54fae9f
2 changed files with 25 additions and 26 deletions

View File

@@ -261,6 +261,7 @@ static RKManagedObjectStore *defaultStore = nil;
{
RKLogDebug(@"primaryManagedObjectContext was saved: merging changes to mainQueueManagedObjectContext");
RKLogTrace(@"Merging changes detailed in userInfo dictionary: %@", [notification userInfo]);
NSAssert([notification object] == self.primaryManagedObjectContext, @"Received Managed Object Context Did Save Notification for Unexpected Context: %@", [notification object]);
[self.mainQueueManagedObjectContext performBlock:^{
[self.mainQueueManagedObjectContext mergeChangesFromContextDidSaveNotification:notification];
}];