views:

401

answers:

2

I want to bind the enabled state of an NSButton to whether or not an NSArrayController has any selected items.

How do I do this?

+3  A: 

Generally speaking, binding the enabled binding to the canRemove property of the array controller should give you what you want. After all, you can only remove an object if there's one selected.

Alex
+3  A: 

Another option is to bind to selectedObjects.count

sbooth
That should be selectedObjects.@count I believe
Mike Abdullah
Yes, you're correct!
sbooth