• 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: Core Data Many2Many Relationships
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data Many2Many Relationships


  • Subject: Re: Core Data Many2Many Relationships
  • From: mmalcolm crawford <email@hidden>
  • Date: Thu, 4 Aug 2005 16:13:27 -0700


On Aug 4, 2005, at 3:08 AM, Bill Cheeseman wrote:

One way to populate the extras relationship in a domain object
programmatically is to make domain a subclass of NSManagedObject and
implement the -add<Keys>Object and related Core Data accessor methods. In
your case, you would name these -addExtrasObject: to link a single extra
object into a domain object, and -addExtras: to add a set of extra objects
to a domain object. Since the relationships are inverse (i.e.,
many-to-many), this would automatically link the domain object to the extra
object (or each of the extras objects) at the same time.



Just for the sake of completeness, the easiest way to do this is simply to use mutableSetValueForKey: (see "To-many Relationships":
<http://developer.apple.com/documentation/Cocoa/Conceptual/ CoreData/Articles/cdRelationships.html>


mmalc

_______________________________________________
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


References: 
 >Re: Core Data Many2Many Relationships (From: Bill Cheeseman <email@hidden>)

  • Prev by Date: Re: Core Data Many2Many Relationships
  • Next by Date: Helper Tool Include Foundation Framework
  • Previous by thread: Re: Core Data Many2Many Relationships
  • Next by thread: Re: Core Data Many2Many Relationships
  • Index(es):
    • Date
    • Thread