Hi all, 

I have a problem with a CoreData-Document. I normally use 
NSManagedObjectContext#existingObjectWithID:error: method
to get the corresponding object for a given Object-ID. According to the 
documentation it should return nil if the 
object cannot be fetched, or does not exist, or cannot be faulted. 

But in this particular document it crashes (EXC_BAD_ACCESS) with: 

#0      0x935e3ed4 in objc_msgSend
#1      0x949ff700 in _PFFaultHandlerFulfillFault
#2      0x949fe585 in _PFFaultHandlerLookupRow
#3      0x94a3bb16 in -[NSFaultHandler fulfillFault:withContext:error:]
#4      0x94a3ba45 in -[NSManagedObjectContext existingObjectWithID:error:]

If I issue a fetch-request with predicate [NSPredicate 
predicateWithFormat:@"self == %@", objectID] and the right
entity it returns an empty array. 

I can exchange the existing existingObjectWithID:error: call with a fetch, but 
the fetch is a lot slower ... 

I guess the document did sometimes contain an object with this objectID but it 
is somehow broken. Is there a 
way to check the integrity of a CoreData-document? (It uses the SQL store, on 
10.6.6 if that matters). 

Thanks in advance, 

Felix



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to