Under most circumstances, it happens automatically: a menu item will be disabled if there is no object in the responder chain that handles the menu's action. If you want to override this behavior or extend it further, overridevalidateMenuItem:
and do something like this:- (BOOL) validateMenuItem: (id <NSMenuItem>) menuItem { BOOL result = YES; if ([menuItem action] == @selector(deleteNote:)) { if ([notes count] == 1) { result = NO; // can't delete the last note } } else if ([menuItem action] == @selector(gotoNote:)) { if ([notes count] == 1) { result = NO; // can't go to a different not if only one } } return (result); } // validateMenuItem