• 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: Chris Hanson <email@hidden>
  • Date: Wed, 14 Jun 2006 23:20:59 -0700

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


  • Follow-Ups:
    • 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: Alexander Lamb <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>)

  • Prev by Date: Re: Difference in relationships storage between various storage options (CoreData)
  • Next by Date: Re: Friendly hint with Font Manager and IB. (Was: Re: Doc App - Errors closing an document.)
  • 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