Load window before main window
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?
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 ...
精彩评论