在主窗口之前加载窗口
我有一个应用程序,有点像与一个主窗口聊天。我需要添加登录窗口,并且该窗口必须在主窗口之前加载。
我尝试用 info.plist“主 nib 文件基本名称”中的登录窗口替换主窗口 xib。登录窗口加载良好,但是之后如何加载主窗口呢?
I have an app somethink like chat with one main window. I need to add login window and this window must loading before main window.
I tried to replace main window xib by login window in info.plist "Main nib file base name". Login window is loading well, but how to load main window after that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果它是非基于文档的应用程序,则 MainMenu.xib 中的唯一窗口设置为在启动时可见(在 Interface Builder 中选择该窗口,然后检查其属性 - 这是一个简单的复选框)。
您想要取消选中在 xib 中为您创建的默认窗口的“启动时可见”,并在您添加的登录窗口中选中它。然后,您可以在需要时通过发送 -makeKeyAndOrderFront: 来显示主窗口:...当然,您需要将 IBOutlet 添加到某个控制器,以便您可以引用该窗口...
If it's a non-document-based application, then the only window in MainMenu.xib is set to be visible at launch (select the window in Interface Builder then inspect its properties - it's a simple checkbox).
You want to uncheck 'visible at launch' for the default window that was created for you in the xib and check it in the login window you added. Then, you can show the main window when you desire by sending it a -makeKeyAndOrderFront: ... of course you'll need to add an IBOutlet to some controller somewhere so you have a reference to that window ...