I successfully stored and retrieved a reference to an NSManagedObject using the example found in this site http://cocoawithlove.com/2008/08/safely-fetching-nsmanagedobject-by-uri.html
The problem is, the app crash whene triying to retrieve an NSManagedObject which has been deleted.
I tried the method isFault on the object, but it always returns no, even if the object IS there.
Here is my code I use to retrieve it:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSData *myData = [prefs objectForKey:@"activatedObject"];
if (myData)
{
NSURL *myURL = [NSKeyedUnarchiver unarchiveObjectWithData:myData];
NSManagedObjectID *myID = [self.persistentStoreCoordinator managedObjectIDForURIRepresentation:myURL];
id myObject = [self.managedObjectContext objectWithID:myID];
self.Object = myObject;
}