How can I prevent making new Untitled document when Mac OS X document based application start up?
Asked Answered
B

1

11

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.

Boehm answered 1/4, 2010 at 6:16 Comment(0)
D
20

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

Drabbet answered 1/4, 2010 at 6:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.