Name

NSMenuValidation — Mac OS X 10.0

Synopsis

This informal protocol declares the single method validateMenuItem:, which is implemented by classes of the a menu’s target object. The class implements this method to return a BOOL specifying whether the menu item should be enabled or disabled. Whenever a menu is displayed, each menu item will send a validateMenuItem: message to its target (if the target responds), which then responds with YES or NO depending on whether or not the menu item should be enabled.

@interface NSObject (NSMenuValidation)
                                  // Instance Methods
   - (BOOL)validateMenuItem:(id <NSMenuItem>)menuItem;
@end

Get Cocoa in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.