views:

36

answers:

1

I'm making a new Mac OS X application. (not an iPhone app) This is document-based application.

It shows a new "Untitled" document instance automatically when it starts up. How can I block this behavior? I wish my application show no window at start up.

+2  A: 

Apple Doc, Document Based application overview - FAQ:

How can I keep my application from creating an untitled document at launch?

Implementing the applicationShouldOpenUntitledFile: method to return NO in your application delegate prevents the application from opening an untitled file when launched or activated. If you do want to open an untitled file when launched, but don't want to open an untitled file when already running and activated from the dock, you can instead implement applicationShouldHandleReopen:hasVisibleWindows: to return NO

stefanB
Super! I'll mark this as answer after 5 minutes!
Eonil