• 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: Difference in relationships storage between various storage options (CoreData)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Difference in relationships storage between various storage options (CoreData)


  • Subject: Re: Difference in relationships storage between various storage options (CoreData)
  • From: Alexander Lamb <email@hidden>
  • Date: Thu, 15 Jun 2006 07:31:51 +0200

It is marked with it's inverse in the model. But doing a "setDepartment" doensn't automagically set the inverse, or does it? At the time of WebObjects it was necessary to do a "addObjectToBothSidesOfRelationshipWithKey". Is it the same with CoreData?

Alex
--
Alexander Lamb
email@hidden



On Jun 14, 2006, at 6:20 PM, Chris Hanson wrote:

On Jun 13, 2006, at 11:49 PM, Alexander Lamb wrote:

Well, I made a mistake in my code somewhere. I set the "employee.department" correctly, but forgot to do an "addObject" to "employee.departements".

The result was not only my object graph was wrong in memory, but it was also wrong in the file! Even restarting the application (reloading data), I had an employee belonging to a department but a department without that same employee.

I assume the second relationship above should be "department.employees".


You should mark the two relationships above as inverses in your data model. This will allow you to manipulate one side of the relationship for an object with Core Data maintaining the other side of it for you automatically.

  -- Chris


_______________________________________________ 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: Difference in relationships storage between various storage options (CoreData)
      • From: Chris Hanson <email@hidden>
    • Re: Difference in relationships storage between various storage options (CoreData)
      • From: mmalcolm crawford <email@hidden>
References: 
 >Difference in relationships storage between various storage options (CoreData) (From: Alexander Lamb <email@hidden>)
 >Re: Difference in relationships storage between various storage options (CoreData) (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: How to make table "NOT" highlight selection?
  • Next by Date: Re: Difference in relationships storage between various storage options (CoreData)
  • Previous by thread: Re: Difference in relationships storage between various storage options (CoreData)
  • Next by thread: Re: Difference in relationships storage between various storage options (CoreData)
  • Index(es):
    • Date
    • Thread