Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 Interface Builder 中为我的应用程序的主菜单禁用了“自动启用菜单项”,因为在加载某些视图时我需要禁用一些菜单。我遇到了一个问题。每当我的应用程序与另一个应用程序(例如 Safari)通信时,所有菜单都会被禁用,我必须强制退出并重新启动应用程序。什么可能导致这种情况发生?
保留“自动启用项目”并禁用您需要通过第一响应者(或指定目标)中-validateUserInterfaceItem:的协议按需禁用的项目。NSUserInterfaceValidations
-validateUserInterfaceItem:
NSUserInterfaceValidations
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/UIValidation/UIValidation.html#//apple_ref/doc/uid/10000040i