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?
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.
Another option is to bind to selectedObjects.@count
This is the answer for IB:
If you need to setup the OR relationship with other NSArrayController (or other value), there is the section Enabled 2 , and so on. So, in my case, i have:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With