1
votes

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
Don't use splash screens; they suck.Mike Abdullah
Have to agree with that one. :-)Joshua Nozzi

1 Answers

2
votes

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];