I have some code that loops through an array of NSManagedObjects and stops when it finds a certain record that is stored in an instance variable. The only way I can manage to see if they are the same record (not an equivalent record, the specific record) is by comparing the URIRepresentations of the objectIDs. This surely cannot be the best way of doing it. I'm doing:
if ([[[obj1 objectID] URIRepresentation] isEqualTo: [[_obj2 objectID] URIRepresentation]]) {
NSLog(@"Match");
}
The following code never matches even when I NSLog the objectIDs and see that they are in fact exactly the same.
if ([[obj1 objectID] isEqualTo: [_obj2 objectID]]) {
NSLog(@"Match");
}