Bound popup's current selection
Bound popup's current selection
- Subject: Bound popup's current selection
- From: Chuck Musser <email@hidden>
- Date: Thu, 29 Jul 2004 08:44:06 -0700
I have a popup's selectedIndex bound to an NSArrayController's
selectionIndex property. This allows the popup to display a text field
of the currently selected array element, but it has an interesting (and
undesirable) side effect. When the underlying array is empty, the popup
displays a large integer value: 2147483647. Once I add an element, the
integer disappears and the popup works nicely.
Is this binding the proper way to do this? It's the closest I can get to
the desired popup behavior: show a blank when the list is empty and show
a label from the selected object when it's not.
I've tried a few other things, like setting the No Selection and Null
Placeholder to "0". These changes had no effect. I also tried a
different binding altogether: binding the popup's selectedValue to the
NSArrayController's selection.label property. That binding results in
odd behavior. I can add one element, but subsequent new elements don't
show up in the popup. Even still, that approach was somewhat
encouraging--with the No Selection Placeholder set to a single space, my
popup started out blank, like I wanted.
Is the proper technique to use my original binding, but delay it until
after the first element is added?
Chuck
_______________________________________________
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.