BUDDAx2
BUDDAx2

Reputation: 399

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?

Upvotes: 0

Views: 425

Answers (1)

Joshua Nozzi
Joshua Nozzi

Reputation: 61228

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 ...

Upvotes: 2

Related Questions