如何将主菜单添加到xib [英] How do I add Main Menu to xib
问题描述
我从我的xib文件中删除了主菜单。我怎么能重新创建它没有应付它从
另一个新创建的xib?
I deleted main menu from my xib file. How can I recreate it without coping it from another freshly created xib?
我不能找到如何告诉IB我从对象添加的菜单库实际上是主应用程序菜单。
I can't seem find how to tell IB that menu that I add from object library is actually main application menu.
推荐答案
你过去可以简单地连接 mainMenu
outlet到你的菜单,但是从Xcode 4,没有 mainMenu
outlet,并且没有替换方法可以在现有nib中创建主菜单。
You can't. You used to be able to simply connect the mainMenu
outlet to your menu, but as of Xcode 4, there is no mainMenu
outlet and there is no replacement way to create a Main Menu in an existing nib.
您必须使用New File命令创建一个新的MainMenu nib, Menu对象,或者用新的替换旧的nib。
You must create a new MainMenu nib using the New File command and either copy the Main Menu object from that nib or just replace the old nib with the new.
这篇关于如何将主菜单添加到xib的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!