• 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: NSPopUpButton and Bindings - using code and description
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPopUpButton and Bindings - using code and description


  • Subject: Re: NSPopUpButton and Bindings - using code and description
  • From: Alan Dail <email@hidden>
  • Date: Mon, 1 Aug 2005 11:11:49 -0400

is there a solution to this with bindings? Thus far the best I've come up with is adding another key which is the formatted version of the data, and write code behind that key to convert to/from the code and store into the code key. i.e. the only thing stored is the code, but the associated description is used to indicate which popup item is chosen. It would seem that there would be a way to do something like this with bindings without resorting to writing code to translate between codes/descriptions.

Alan

On Jul 29, 2005, at 4:37 PM, Alan Dail wrote:

I have a NSPopUpButton for selecting a state. I have a table that has stateCode and stateName that I want to use to build the popupList and have an object that contains/drives the selected state code. What I'd like to do is somehow store the stateCode but display the associated stateName.

Using bindings, I have selectedValue bound to myObject.stateCode, have content bound to stateList. I can then bind contentValue to stateList.stateCode and my popup works, but displays the code. Is there a way through bindings to have the display tied to one key, but the stored value tied to a different key of the same object?

Alan
_______________________________________________
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


  • Prev by Date: Re: NSSegmentedControl Display Bug?
  • Next by Date: Re: Catching a click during a loop
  • Previous by thread: Re: menu item alignment question
  • Next by thread: Re: Catching a click during a loop
  • Index(es):
    • Date
    • Thread