• 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: CoreData many-to-many Relationship Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >CoreData many-to-many Relationship Question (From: Jean-Nicolas Jolivet <email@hidden>)

  • Prev by Date: Re: Document-Based Application
  • Next by Date: Re: Cocoa Document-Based App v. Windows MDI App
  • Previous by thread: CoreData many-to-many Relationship Question
  • Next by thread: Ordered Arrays for Core Data managed objects
  • Index(es):
    • Date
    • Thread