Last active
December 14, 2015 15:49
-
-
Save lukeredpath/5110534 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSManagedObjectContext *contextOne = ...; | |
NSArray *objects = ...<result of fetch request on contextOne... | |
NSManagedObjectID *objectID = objects[0].objectID; | |
NSManagedObjectContext *contextTwo = ...; | |
id object = [contextTwo existingObjectWithID:objectID error:nil]; // returns the right object | |
NSAssert(![object.objectID isTemporaryID]); // passes | |
id otherObject = [contextTwo objectWithID:objectID]; // always returns an object, should be the right object | |
NSAssert(![otherObject.objectID isTemporaryID]); // fails! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment