• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: "Dangling reference to an invalid object"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "Dangling reference to an invalid object"


  • Subject: Re: "Dangling reference to an invalid object"
  • From: Nick Zitzmann <email@hidden>
  • Date: Mon, 03 Dec 2012 11:13:06 -0700

On Dec 1, 2012, at 10:33 AM, Mike Abdullah <email@hidden> 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@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: "Dangling reference to an invalid object"
      • From: Mike Abdullah <email@hidden>
References: 
 >"Dangling reference to an invalid object" (From: Mike Abdullah <email@hidden>)

  • Prev by Date: PDFActionRemoteGoTo won't save?
  • Next by Date: Get the current displayed NSAlert
  • Previous by thread: "Dangling reference to an invalid object"
  • Next by thread: Re: "Dangling reference to an invalid object"
  • Index(es):
    • Date
    • Thread