Using bindings to disable a control when a list is empty

Using bindings to disable a control when a list is empty

Need to disable a control such as a button when a list or table is empty? It's easy to do with bindings.

Let's assume you have an NSTableView displaying some items from an NSArrayController, and you want to disable a button when the table contains no items.
All you need to do is bind the button's "enabled" binding to your array controller's contentArray, using @count as the model key.

Comments

Any good reference?

Is there any good reference that lists all the aggregate operators like @count along with their descriptions?