• 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
(Inverse) relationship lost after being set properly
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(Inverse) relationship lost after being set properly


  • Subject: (Inverse) relationship lost after being set properly
  • From: Doug Knowles <email@hidden>
  • Date: Fri, 24 Jun 2005 01:02:25 -0400

I have a Core Data application that constructs a hierarchy of managed
objects from an XML payload.  The objects have a conventional tree
relationship (as you might expect from XML data): a "parent" has a
to-many relationship to the "children", which have an inverse to-one
relationship to the parent.  The construction of the tree of managed
objects from the XML appears to work fine.

The application occasionally re-loads the XML data, during which it
fetches a new XML payload and adds the new "children" to the original
"parent".  I'm using mutableSetValueForKey and addObject to "move" the
new children to the old parent.  I have confirmed (via NSLog debug
statements) that the children's "parent" reference is being correctly
updated when they are added to the "old" parent's mutableSet.

However, shortly thereafter, if I examine the "new" children, their
"parent" entity references are now nil; these references are somehow
being reset to a bad value (nil) after I confirm that they have been
correctly updated.

Does this ring a bell for anyone?  I have read threads where the
inverse relationship spec is sometimes broken, but I don't think
that's the problem here, since the children's to-one "parent"
attribute is shown to be properly updated after the parent's to-many
"child" attribute is modified; the damage appears to be inflicted
later.

Thanks in advance,

Doug Knowles
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: (Inverse) relationship lost after being set properly
      • From: Doug Knowles <email@hidden>
  • Prev by Date: Core Data relationships
  • Next by Date: Re: Core Data relationships
  • Previous by thread: Re: Core Data relationships
  • Next by thread: Re: (Inverse) relationship lost after being set properly
  • Index(es):
    • Date
    • Thread