Cannot seem to setEnabled:NO on NSMenuItem

后端 未结 8 1476
故里飘歌
故里飘歌 2021-02-12 10:51

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 initi

8条回答
  •  走了就别回头了
    2021-02-12 11:12

    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's awakeFromNib.

提交回复
热议问题