• 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 10:44:52 +0200

That's what I suspected, but then it means there is a bug in my code which prevents the reverse relationship being set.

Thanks,

Alex
--
Alexander Lamb
email@hidden



On Jun 15, 2006, at 8:20 AM, Chris Hanson wrote:

On Jun 14, 2006, at 10:31 PM, Alexander Lamb wrote:

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?

So long as -setDepartment: is implemented correctly -- e.g. it invokes -willChangeValueForKey: and -didChangeValueForKey: as specified in the documentation -- both the "Employee.department" relationship and its inverse "Department.employees" relationship will be maintained automatically.


Similarly, if you either use a properly-implemented accessor method on Department for the "employees" relationship or manipulate the result of -mutableSetValueForKey: then both the "Department.employees" and it inverse "Employee.department" relationship will be maintained automatically.

There's nothing like -addObject:toBothSidesOfRelationshipWithKey: necessary in Core Data.

  -- 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
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>)
 >Re: 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: Disallow edit for rows in NSOutlineView
  • 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