• 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: Addressing Relationships in awakeFromInsert
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Addressing Relationships in awakeFromInsert


  • Subject: Re: Addressing Relationships in awakeFromInsert
  • From: mmalcolm crawford <email@hidden>
  • Date: Wed, 10 Aug 2005 14:02:21 -0700


On Aug 10, 2005, at 1:31 PM, August Trometer wrote:

At no point am I setting the Master object -- this should be done automatically. I'm assuming (maybe incorrectly?) that because of the inverse Relationship set up between the Master and Detail Entities that the "master" Relationship in my Detail object automatically points back to the Master object that it's created within.

"It is important to note that simply defining a relationship does not cause a destination object to be created when a new source object is created. In this respect, defining a relationship is akin to declaring an instance variable in a standard Objective-C class. Consider the following example.


@interface Widget : NSObject
{
Sprocket *_sprocket;
}
If you create an instance of Widget, an instance of Sprocket is not created unless you write code to cause it to happen (for example, by overriding the init method). Similarly, if you define an Address entity, and a non-optional to-one relationship from Employee to Address, then simply creating an instance of Employee does not create a new Address instance. Likewise, if you define a non-optional to- many relationship from Employee to Address with a minimum count of 1, then simply creating an instance of Employee does not create a new Address instance."


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
  • Follow-Ups:
    • Re: Addressing Relationships in awakeFromInsert
      • From: August Trometer <email@hidden>
References: 
 >Addressing Relationships in awakeFromInsert (From: August Trometer <email@hidden>)
 >Re: Addressing Relationships in awakeFromInsert (From: Jim Correia <email@hidden>)
 >Re: Addressing Relationships in awakeFromInsert (From: August Trometer <email@hidden>)

  • Prev by Date: Re: Question about Threading
  • Next by Date: Re: NSBrowser_NSTextView
  • Previous by thread: Re: Addressing Relationships in awakeFromInsert
  • Next by thread: Re: Addressing Relationships in awakeFromInsert
  • Index(es):
    • Date
    • Thread