An NSMenuItem object that represents the menu item.
Instance Method
インスタンスメソッド
validate
validateMenuItem:
Implemented to override the default action of enabling or disabling a specific menu item.
Availability
- macOS 10.0–11.0 Deprecated
Technology
- App
Kit
Declaration 宣言
- (BOOL)validateMenuItem:(NSMenuItem
*)menuItem;
Parameters パラメータ
menuItem
Return Value 戻り値
YES
to enable menu
, NO
to disable it.
Discussion 解説
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.)