Xcode如何决定先显示哪个XIB [英] How does Xcode decide which XIB to show first

查看:176
本文介绍了Xcode如何决定先显示哪个XIB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在Xcode中创建一个新的可可项目时,它创建一个带有Window的MainMenu.xib文件。我想将窗口分成一个MainWindow.xib并显示为主窗口 - 我该怎么做?

When I create a new cocoa project in Xcode, it creates a MainMenu.xib file with a Window. I would like to separate the window into a MainWindow.xib and have that show up as the main window - how do I do that?

如果我创建一个'document'基于应用程序 - 我看到两个xib(MainMenu.xib和MyDocument.xib),我注意到MyDocument.xib立即显示 - 但我不知道这在哪里被标识。似乎没有明确的代码,我不知道在plists看哪里。

If I create a 'document' based application - I see two xibs (MainMenu.xib and MyDocument.xib) and I notice that MyDocument.xib gets displayed right away - but I don't understand where this is identified. There doesn't seem to be explicit code and I'm not sure where to look in the plists.

如果我创建一个新的文档,如何使它我在启动应用程序时显示的主窗口。< YourProjectName> -Info。

If I create a new Document, how can I make it the primary window that shows up when I start the app?

推荐答案

plist 你会发现关键的主要nib文件基本名称,与第一个xib的值通常加载MainMenu。

in <YourProjectName>-Info.plist you'll find the key "Main nib file base name", with the value of the first xib to load usually "MainMenu".

还有文档类型 - >项目0 - >Cocoa NSDocument类,值为MyDocument。在类MyDocument中有一个方法 - (NSString *)windowNibName 。这返回第一个要加载的xib的名称。

Also you'll find "Document types" -> "Item 0" -> "Cocoa NSDocument Class" and there the value "MyDocument". In the class "MyDocument" there is a method - (NSString *)windowNibName. This return the name of the first xib to load.

这篇关于Xcode如何决定先显示哪个XIB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆