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

Re: Binding to to-one relationship


  • Subject: Re: Binding to to-one relationship
  • From: Matt Neuburg <email@hidden>
  • Date: Fri, 06 Jan 2006 10:11:22 -0800
  • Thread-topic: Binding to to-one relationship

On Thu, 5 Jan 2006 21:44:41 -0500, Jeff LaMarche <email@hidden>
said:
>Okay, I've got an entity with a to-one relationship to another
>entity. So, for example, I have a Person entity with a to-one
>relationship called primaryPhone to a PhoneNumber entity. The Person
>entities are being managed by an array controller and I'm currently
>connecting buttons directly to the array controller's add: action to
>create new Person entities. I want to display the phone number fields
>right along with the other fields from the selected Person entity
>using a keypath primaryPhone.number for example.
>
>Only problem is, the PhoneNumber entity is never getting created, so
>any values entered into the phone number fields aren't going
>anywhere. Is there a way to have it automatically create the
>PhoneNumber entity when the array controller inserts a new Person
>entity, or do I have to use a custom method for adding objects and
>manually creates the PhoneNumber entity and sticks it in the to-one
>relationship?

Not quite sure what "it" is in that sentence, but it sounds like you want to
override awakeFromInsert (this is, in effect, the "designated initializer").
m.

--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>



 _______________________________________________
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: Binding to to-one relationship
      • From: mmalcolm crawford <email@hidden>
  • Prev by Date: Re: Crash in _blinkCaretTimerAction (NSTextView)
  • Next by Date: Re: NSSearchField - detect loss of focus
  • Previous by thread: Re: Binding to to-one relationship
  • Next by thread: Re: Binding to to-one relationship
  • Index(es):
    • Date
    • Thread