• 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, multiple selection, multiple values == trouble
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSComboBox, binding, multiple selection, multiple values == trouble


  • Subject: Re: NSComboBox, binding, multiple selection, multiple values == trouble
  • From: Markus Spoettl <email@hidden>
  • Date: Wed, 23 Jan 2013 22:54:24 +0100

On 1/23/13 10:25 PM, Keary Suska wrote:
This works reasonably well but I wonder how others have fixed this problem.
I feel returning NSMultipleValuesMarker is a hack which works only because
NSComboBox thinks it's a legitimate return value (or doesn't care). The
fact that I can't clear properties for multiple selections is a side effect
I can live with.

This actually works? I wouldn't think so--I would expect that all of the
field values get set to the string value of NSMultipleValuesMarker, which is
really what the code looks like it should be doing. If there are indeed some
internals that are ignoring the marker, they are undocumented (AFAIK) and
shouldn't be relied upon.

Yes, it works. My theory is that the NSArrayController, which is actually updating the model via its selection proxy, does the right thing when it gets a NSMultipleValuesMarker back as object value.

Any better fixes for this?

If you are really dedicated to using NSCombobox, I would avoid bindings and
instead handle it manually, using target-action. This way, when your
controller receives the action you can check for a multiple selection and
ignore it if so.

Yes, that may be an option, though not a very convenient one. Getting rid of NSComboBox altogether may be more attractive.

Regards
Markus
--
__________________________________________
Markus Spoettl

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSComboBox, binding, multiple selection, multiple values == trouble (From: Markus Spoettl <email@hidden>)
 >Re: NSComboBox, binding, multiple selection, multiple values == trouble (From: Keary Suska <email@hidden>)

  • Prev by Date: Re: NSComboBox, binding, multiple selection, multiple values == trouble
  • Next by Date: New iTunes UI
  • Previous by thread: Re: NSComboBox, binding, multiple selection, multiple values == trouble
  • Next by thread: New iTunes UI
  • Index(es):
    • Date
    • Thread