views:

30

answers:

1

I have a document-based Cocoa application that has to start up a sub-process before running. It would be best if that process could finish starting up before I display any document windows. I get a notification when the process has fully started.

How can I delay the creation of the untitled NSDocument subclass object until the notification arrives? I have a splash screen and a timeout, so I can "busy wait" and still get user-generated events. I can override any class I need to.

+1  A: 

See the -applicationShouldOpenUntitledFile: delegate method. You can say "NO" and create the untitled document on your own when you're ready with the following code:

[[NSDocumentController sharedDocumentController] newDocument:self];
Joshua Nozzi
That worked perfectly. I wait for the notification to come in, and I call the above code.Thank you.
Mel