tags:

views:

13

answers:

1

How can I tell when all of the MainMenu nib controls (primarily the main window) have been loaded? I want to display a sheet on top of the main window at launch, but when I put call beginSheet inside of awakeFromNib, I get an error because no windows have been displayed yet: : kCGErrorIllegalArgument: _CGSFindSharedWindow: WID -1

How can this be fixed?

+1  A: 

For this type of action, I'd suggest using the -applicationDidFinishLaunching delegate method. You'll implement this in your application delegate. Start the sheet from there and you're guaranteed that MainMenu.nib/xib is loaded by then.

Joshua Nozzi