Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

isthisonetaken

macrumors regular
Original poster
Jun 29, 2006
123
0
Hey all,

so I have an application which starts with a login window, and after successful login opens the main window. What I would like to have happen, is once the login is successful, load the information I need from the database to populate the main window, then show the main window and close the login.

So far, I have both windows in MainMenu.xib, the main window is hidden at launch, the login window shows, and the login code is written and works. When the login is successful I call this code:
Code:
[blackboxWindow orderFront:self];
		[loginWindow close];
I have the code to initialize blackboxWindow in awakeFromNib and my problem is that I have a NSRunAlert to show me what is being returned, and that is popping up even before the login window shows.

I feel like the problem is in the awakeFromNib, but if I put the code in the applicationDidFinishLaunching, the same problem happens. Is there a way to call something like applicationDidFinishLaunching, but just before a window is shown?

Thanks,

Dan
 

gnasher729

Suspended
Nov 25, 2005
17,980
5,565
Hey all,

so I have an application which starts with a login window, and after successful login opens the main window. What I would like to have happen, is once the login is successful, load the information I need from the database to populate the main window, then show the main window and close the login.

So far, I have both windows in MainMenu.xib, the main window is hidden at launch, the login window shows, and the login code is written and works. When the login is successful I call this code:
Code:
[blackboxWindow orderFront:self];
		[loginWindow close];
I have the code to initialize blackboxWindow in awakeFromNib and my problem is that I have a NSRunAlert to show me what is being returned, and that is popping up even before the login window shows.

I feel like the problem is in the awakeFromNib, but if I put the code in the applicationDidFinishLaunching, the same problem happens. Is there a way to call something like applicationDidFinishLaunching, but just before a window is shown?

Well, yes. Just write some code and call it before you call orderFront.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.