On Dec 1, 2012, at 10:33 AM, Mike Abdullah <[email protected]> wrote:

> I've been trying to hunt down a problem where Core Data will occasionally 
> refuse to save with the error "
> Dangling reference to an invalid object". I wrote up the details here: 
> http://www.mikeabdullah.net/dangling-ref-to-an-invalid-object.html
> 
> Can anyone shed some light on how this might happen?

This exception happens if you:

1. Create a new object
2. Create a relationship between the new object and an existing object
3. Turn the new object into a fault before it is officially inserted
4. Save changes

So if you're getting this exception, you need to be more careful about using 
the -refreshObject:mergeChanges: method, because the code is most likely 
misusing it. One way to fix this is to never refresh an object that has a 
temporary object ID.

Nick Zitzmann
<http://www.chronosnet.com/>


_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to