プログラムで NSMenuItem を作成しましたが、無効になっています。validateMenuItem: メソッドをオーバーライドして、すべての項目に対して YES を返すと、メニュー項目は正常に機能します。
メニューに autoEnableItems を指示し、validateMenuItem: メソッドをオーバーライドしないと有効にならないのはなぜですか?
NSMenuItem *menuItem = [[NSMenuItem alloc] initWithTitle:label action:@selector(methodToLogSomething:) keyEquivalent:@""];
menuItem.representedObject = representedObject;
[menuItem setTarget:self];
[menu insertItem:menuItem atIndex:[[menu itemArray] count]-1];
[menuItem release];
[menu setAutoenablesItems:YES];