O'Reilly logo

Cocoa in a Nutshell by James Duncan Davidson, Michael Beam

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required