Implemented to override the default action of enabling or disabling a specific menu item.
- macOS 10.0+
An NSMenuItem object that represents the menu item.
true to enable
false to disable it.
The object implementing this method must be the target of
menu. You can determine which menu item
menu is by querying it for its tag or action.
The following example disables the menu item associated with the
next action method when the selected line in a table view is the last one; conversely, it disables the menu item with
prior as its action method when the selected row is the first one in the table view. (The
country array contains names that appear in the table view.)