I have subclassed NSMenu
and connected a bunch of NSMenuItem
's via Interface Builder. I have tested via the debugger to see that they really get initialized.
The menu is set to not auto enable items. Still when I set any of my NSMenuItem's to [myMenuItem setEnabled:NO]
they continue to be enabled. Even if I call [self update]
from within the NSMenu subclass.
What am I missing?
Try calling
[myMenuItem setEnabled:NO]
from a different place and making sure that it happens after the menu-containing nib is loaded. Maybe do it right in the subclassed NSMenu'sawakeFromNib
.You should uncheck Auto Enables Items on the closest parent NSMenu