• 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
Bound popup's current selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • WORKAROUND: Bound popup's current selection
      • From: Chuck Musser <email@hidden>
  • Prev by Date: DVD Studio Pro
  • Next by Date: Re: DVD Studio Pro
  • Previous by thread: Re: DVD Studio Pro
  • Next by thread: WORKAROUND: Bound popup's current selection
  • Index(es):
    • Date
    • Thread