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

CoreData many-to-many Relationship Question


  • Subject: CoreData many-to-many Relationship Question
  • From: Jean-Nicolas Jolivet <email@hidden>
  • Date: Fri, 24 Jul 2009 13:23:44 -0400

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

  • Follow-Ups:
    • Re: CoreData many-to-many Relationship Question
      • From: Bryan Henry <email@hidden>
  • Prev by Date: Re: Cocoa Document-Based App v. Windows MDI App
  • Next by Date: Ordered Arrays for Core Data managed objects
  • Previous by thread: Re: Cocoa Document-Based App v. Windows MDI App
  • Next by thread: Re: CoreData many-to-many Relationship Question
  • Index(es):
    • Date
    • Thread