• 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: Binding NSMenuItem 1 to 1
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding NSMenuItem 1 to 1


  • Subject: Re: Binding NSMenuItem 1 to 1
  • From: Jeff Johnson <email@hidden>
  • Date: Tue, 21 Aug 2007 13:49:30 -0500

On Aug 21, 2007, at 1:35 PM, mmalc crawford wrote:

On Aug 21, 2007, at 10:20 AM, Jeff Johnson wrote:

I agree that the arbitrary key is fragile. My thought was just to use the array controller's "selection", without any other key. If there's no selection or multiple selections, it will return the appropriate placeholder. Otherwise, just check whether selection is non-nil.

It's not clear what you mean here.
My understanding is that the goal is to conditionally enable a UI element if the count of the selected items is 1, and only 1.
The 'enabled' binding requires an NSNumber object (representing a Boolean value). Neither placeholder is an NSNumber instance. Checking whether the selection is non-nil does not account for the case where the count of selected items is greater than 1.


mmalc

The controller's selection returns NSMultipleValuesMarker when there are multiple items selected. The binding's NSMultipleValuesPlaceholderBindingOption specifies a placeholder to use when the binding's keypath returns NSMultipleValuesMarker. The placeholder will give you the boolean value.


-Jeff

_______________________________________________

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: 
 >Re: Binding NSMenuItem 1 to 1 (From: Knut Lorenzen <email@hidden>)
 >Re: Binding NSMenuItem 1 to 1 (From: mmalc crawford <email@hidden>)
 >Re: Binding NSMenuItem 1 to 1 (From: Jeff Johnson <email@hidden>)
 >Re: Binding NSMenuItem 1 to 1 (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Binding NSMenuItem 1 to 1
  • Next by Date: Re: Notifying when a key is pressed and perform default tasks.‎
  • Previous by thread: Re: Binding NSMenuItem 1 to 1
  • Next by thread: Cannot Bind Pop Up Button to Array of Dictionaries
  • Index(es):
    • Date
    • Thread