Launching a document-based app with no document
Launching a document-based app with no document
- Subject: Launching a document-based app with no document
- From: Dylan McNamee <email@hidden>
- Date: Thu, 27 Aug 2009 12:49:04 -0700
Which hook should I use to detect that my document-based app has been
launched without a document having been dropped on it (or double-
clicked upon)?
Right now my app just launches and shows its menu.
What I'd like to do is catch this case, and at least pop up an "Open"
dialog.
I tried checking the length of the "orderedDocuments" array at the end
of my MenuController's awakeFromNib handler, but that's too soon -
it's always empty at that point.
Should I register a listener for applicationDidFinishLaunching?
In reading the documentation for the various info.plist options, I
half-expected an option that says something like
"openDialogOnLaunchIfNoDefaultDocument" or something, but came up dry.
Googling the documentation and this list popped up way too many
negative hits (I guess the obvious keywords are too generic). Where
would someone start looking to find answers to questions like this?
NSApplication's documentation wasn't it, the various books I own
didn't cover this case (that I saw).
thanks,
dylan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden