• 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: A Binding Question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >A Binding Question (From: "Tony S. Wu" <email@hidden>)
 >Re: A Binding Question (From: Scott Anguish <email@hidden>)

  • Prev by Date: DotMacKit 2.0?
  • Next by Date: Re: Binding a PopUpButton with images in the menu?
  • Previous by thread: Re: A Binding Question
  • Next by thread: NSPredicate bombing, help
  • Index(es):
    • Date
    • Thread