Re: A Binding Question
Re: A Binding Question
- Subject: Re: A Binding Question
- From: Scott Anguish <email@hidden>
- Date: Sat, 2 Jul 2005 03:11:54 -0400
Gah, I messed up
bind the enabled binding to the array controller's selectedObjects
with the keypath @count
write a quickie value transformer that checks if the incoming value
is 1, if it is return YES, otherwise NO
http://homepage.mac.com/ValueTransformers/TrueIfOneValueTransformer.zip
You'll need to register that VT in your application first.. the doc
covers that though)
(You could actually adapt it by adding an initWithNumber: method to
be more generic. then you'd init and register it with a specific name)
On Jul 2, 2005, at 2:08 AM, Scott Anguish wrote:
sure...
bind the enabled binding to the array controller's arrangedObjects
with the keypath @count
with a count of 0 it is disabled, anything else is true
On Jul 2, 2005, at 1:40 AM, Tony S. Wu wrote:
i bind a NSButton's "enabled" to a NSArrayController.
but i want the NSButton to be enabled only when NSArrayController
has "one" object selected.
is this possible?
thanks.
Tony S. Wu
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden