• 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: Can you "bind" two values into one?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can you "bind" two values into one?


  • Subject: Re: Can you "bind" two values into one?
  • From: mmalc Crawford <email@hidden>
  • Date: Wed, 23 May 2007 09:55:52 -0700


On May 23, 2007, at 8:44 AM, Jerry Krinock wrote:

For the last hour, I've been trying to figure out how to bind two table columns such as this to a single string in storage, bidirectionally, using Cocoa bindings.

Bidirectionally you can't (in the read-only direction you can use pattern values).

But I keep running into a wall, trying to transform two objects into one. What's the smart way to do this?

In your model class, implement accessors for fullName.
-fullName returns the appropriate concatenation of firstName and lastName.
-setFullName: parses the input parameter into firstName and lastName and sets their values.


Also implement validateFullName:error: to validate the input value to ensure it can be parsed (and probably set the Validates Immediately option on the text field).

mmalc


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Can you "bind" two values into one?
      • From: Jerry Krinock <email@hidden>
References: 
 >Can you "bind" two values into one? (From: Jerry Krinock <email@hidden>)

  • Prev by Date: Re: Can you "bind" two values into one?
  • Next by Date: how to recognize if there is a fullscreen app running
  • Previous by thread: Re: Can you "bind" two values into one?
  • Next by thread: Re: Can you "bind" two values into one?
  • Index(es):
    • Date
    • Thread