Permalink
Browse files

Obtain permanent IDs on inserted objects before saving

  • Loading branch information...
1 parent b2bc56b commit 578f4b8f04739f414ec998f1812bdd04520783c7 @blackgold9 blackgold9 committed Sep 7, 2012
@@ -17,6 +17,8 @@ - (void)setUpContextsWithCoordinator:(NSPersistentStoreCoordinator *)coordinator
NSManagedObjectContext *defaultContext = [NSManagedObjectContext MR_newMainQueueContext];
[defaultContext setParentContext:rootContext];
[NSManagedObjectContext MR_setDefaultContext:defaultContext];
+ [NSManagedObjectContext MR_makeContextObtainPermanentIDsBeforeSaving:defaultContext];
+ [NSManagedObjectContext MR_makeContextObtainPermanentIDsBeforeSaving:rootContext];
[NSManagedObjectContext MR_makeContext:rootContext mergeChangesToContext:defaultContext];
}
@@ -33,7 +33,8 @@ - (void)setUpContextsWithCoordinator:(NSPersistentStoreCoordinator *)coordinator
// Use the coordinator passed in
[defaultContext setPersistentStoreCoordinator:coordinator];
[NSManagedObjectContext MR_setDefaultContext:defaultContext];
-
+ [NSManagedObjectContext MR_makeContextObtainPermanentIDsBeforeSaving:defaultContext];
+ [NSManagedObjectContext MR_makeContextObtainPermanentIDsBeforeSaving:rootContext];
[NSManagedObjectContext MR_makeContext:rootContext mergeChangesToContext:defaultContext];
[NSManagedObjectContext MR_makeContext:defaultContext mergeChangesToContext:rootContext];
}

0 comments on commit 578f4b8

Please sign in to comment.