Re: Binding NSMenuItem 1 to 1
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