• 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: NSCombobox binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCombobox binding


  • Subject: Re: NSCombobox binding
  • From: mmalcolm crawford <email@hidden>
  • Date: Mon, 26 Jul 2004 12:34:00 -0700

On Jul 26, 2004, at 11:53 AM, Olivier Destrebecq wrote:

I read the documentation on apple web site and still can't get it to work.
Here is the description of the content binding from a combobox from apple website
" content
An NSArrayController instance that provides the content of the NSComboBox.
Unless contentValues is also bound, the titles of the items in the NSComboBox are derived by invoking description for each of the content objects." [...]
Unfortunately it seem like it manage to get a hold of the object in the array, but it never send them the description message.

It looks like that might be a bug.

If i understand this i just need to get this binding to point to an array controller and put arrangedObject for the controllerKey
Then implement the description method in the object contained by the array.

You can either implement -description or another method that returns whatever value you want to display, then bind the combo box's 'contentValues' binding:

[Array Controller].arrangedObjects.valueToDisplay

If you've already implemented -description, you could bind to:

[Array Controller].arrangedObjects.description

if i bound the contentValue then the value in the drop menu are displayed correctly but it still pass the string value for the selected object and not the actual object.

The 'value' of a combo box is either a string or a number -- not the "selected object" (what is the object in the case where the user types in a value?). If you want to select from a static list of objects, use a popup.

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: NSCombobox binding
      • From: Scott Anguish <email@hidden>
References: 
 >NSCombobox binding (From: Olivier Destrebecq <email@hidden>)

  • Prev by Date: Re: Build objects at runtime
  • Next by Date: Re: Build objects at runtime
  • Previous by thread: NSCombobox binding
  • Next by thread: Re: NSCombobox binding
  • Index(es):
    • Date
    • Thread