Log when trying to use inContext: method and result is nil

This commit is contained in:
Saul Mora
2012-12-22 14:17:45 -07:00
parent a3bf426353
commit dce1a54e88

View File

@@ -245,6 +245,10 @@ static NSUInteger defaultBatchSize = kMagicalRecordDefaultBatchSize;
NSError *error = nil;
NSManagedObject *inContext = [otherContext existingObjectWithID:[self objectID] error:&error];
[MagicalRecord handleErrors:error];
if (inContext == nil)
{
MRLog(@"Did not find object %@ in context %@", self, otherContext);
}
return inContext;
}