Re: CoreData many-to-many Relationship Question
Re: CoreData many-to-many Relationship Question
- Subject: Re: CoreData many-to-many Relationship Question
- From: Bryan Henry <email@hidden>
- Date: Sun, 26 Jul 2009 23:25:49 -0500
Yes, as long as you object graphic consistency for you. You should
look at the Core Data Programming Guide, which this excerpt is from:
"Since Core Data takes care of the object graph consistency
maintenance for you, you only need to change one end of a relationship
and all other aspects are managed for you. This applies to to-one, to-
many, and many-to-many relationships."
- Bryan
On Jul 24, 2009, at 12:23 PM, Jean-Nicolas Jolivet wrote:
I'm using a many-to-many relationship with CoreData and I was
wondering if I
have to set or unset the relationshop both ways?
For example, let's say I have a many-to-many relationship between an
Employee entity and a Manager entity...if I do the following:
[anEmployee addManagersObject:aManager];
I add the Manager to the Employee's Managers... but is the Employee
added to
the Manager's Employee automatically (in other words, is the inverse
relationshop created automatically for me, or do I also have to do:
[aManager addEmployeesObject:anEmployee];)
Same for removeManagersObject and removeEmployeesObject... can I
only delete
one side of the relationship or do I have to delete both?
Hopefully my question is clear, if not let me know I'll try to
explain it
better...
Jean-Nicolas Jolivet
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden