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 09:20:52 -0700
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