Bind enabled of MenuItem to ArrayController selection

I’ve seen on various Cocoa forums that it is possible to bind enabled of a menu item (in this case a Popup menu item) to an Array Controller’s selection. Here’s an example: http://stackoverflow.com/questions/5481817/how-do-i-bind-an-nsmenuitem-to-an-nsarraycontroller, and kind of another using a button: http://stackoverflow.com/questions/1872484/enabling-nsbutton-with-bindings-based-on-nstableview-selection. I don’t want the menu item to be enabled unless a row is selected in the TableView (only one row can be selected at a time).

However, after setting this up my menu item is always enabled. Even if I uncheck Enabled in the particular Menu Item’s Attributes. This indicates to me that something is working, just not the right way.

Otherwise, Array Controller is working just fine. Does anyone have an idea what I may be doing incorrectly?

TIA.

Bind the menu item to the array controller with the Controller Key, selectedObjects, and a Model Key Path of @count (with nothing in the value transformer field). You can also use the Controller Key “canRemove” with nothing in the Model Key Path or Value Transformer fields.

Ric

Ric,

Thanks. Worked perfectly.