I have an NSDocument-based application whose documents are not exactly "light-weight". Initializing a new document requires some up-front configuration choices by the user (like starting a new project in Xcode).
By default, when my app starts up it opens a document window with a blank document, and if the Dock icon is clicked when the application does not have a document open, it does the same... effectively creating a blank document in an invalid state. From a user perspective, this isn't appropriate behavior, as starting a new project document is not something done frequently (again, similar to Xcode).
Where can I hook into in the document/window controller/app lifecycle to prevent this behavior?
(edited to fix formatting the forum software munged)