• 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: One-to-many relationship
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: One-to-many relationship


  • Subject: Re: One-to-many relationship
  • From: mmalc crawford <email@hidden>
  • Date: Wed, 26 Sep 2007 22:34:42 -0700


On Sep 26, 2007, at 10:23 PM, Norio Ota wrote:

But how should I connect the department object to 'department' of Employ object.

Is the following code OK?

[iEmployee setValue:deptObject forKey:@"department"];

Yes: <http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdUsingMOs.html >.

Note, though, that if you have properly modeled the inverse relationship you only have to set one side (that is, if you add an employee to the employees relationship you don't have to set the department relationship and vice-versa).

"Most relationships are inherently bidirectional. Any changes made to the relationships between objects should maintain the integrity of the object graph. Provided that you have correctly modeled a relationship in both directions and set the inverses, modifying one end of a relationship automatically updates the other end—see “Manipulating Relationships and Object Graph Integrity”."

mmalc

_______________________________________________

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: 
 >Cocoa won't draw CMYK jpeg (From: Robert Clair <email@hidden>)
 >Re: Cocoa won't draw CMYK jpeg (From: Scott Thompson <email@hidden>)
 >Re: Cocoa won't draw CMYK jpeg (From: Robert Clair <email@hidden>)
 >Re: Cocoa won't draw CMYK jpeg (From: Scott Thompson <email@hidden>)
 >Re: Cocoa won't draw CMYK jpeg (From: Robert Clair <email@hidden>)
 >Re: Cocoa won't draw CMYK jpeg (From: Scott Thompson <email@hidden>)
 >One-to-many relationship (From: Norio Ota <email@hidden>)

  • Prev by Date: One-to-many relationship
  • Next by Date: Re: Convenience Methods
  • Previous by thread: One-to-many relationship
  • Next by thread: CD-DA analysis
  • Index(es):
    • Date
    • Thread