Re: NSCombobox binding
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.