Problem with disappearing NSMenuItems
-
13-10-2019 - |
Pergunta
I disabled "auto-enables menu items" for my app's main menu in Interface Builder because I need to disable some menus when certain views are loaded. I am running into a problem though. Whenever my application communicates with another application (e.g. Safari) all the menus become disabled and I have to force-quit and restart the application. What could be causing this to happen?
Solução
Leave "Auto Enables Items" on and disable the items you need to disable on-demand via -validateUserInterfaceItem:
from the NSUserInterfaceValidations
protocol in your first responder (or designated target).
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow