开发者

Problem with disappearing NSMenuItems

开发者 https://www.devze.com 2023-02-01 19:22 出处:网络
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 lo开发者_如何学Caded. I am running into a problem though

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 lo开发者_如何学Caded. 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?


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).

http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/UIValidation/UIValidation.html#//apple_ref/doc/uid/10000040i

0

精彩评论

暂无评论...
验证码 换一张
取 消