Re: Difference in relationships storage between various storage options (CoreData)
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