Re: Launching a document-based app with no document
Re: Launching a document-based app with no document
- Subject: Re: Launching a document-based app with no document
- From: Ken Thomases <email@hidden>
- Date: Fri, 28 Aug 2009 04:54:06 -0500
On Aug 27, 2009, at 2:49 PM, Dylan McNamee wrote:
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.
A document-based app will automatically open a new untitled document
under those circumstances, by default. To make it not do that, you
have to return NO from the Application delegate's -
applicationShouldOpenUntitledFile: method. Naturally, if you want to
not open a new untitled document but also do something else, you
should have that method do the "something else" and also return NO.
You should also pay attention to the -
applicationShouldHandleReopen:hasVisibleWindows: delegate method if
you want to do something different on first launch vs. the user
"relaunching" your app (by double-clicking it in the Finder or click
on its Dock icon) when it's already running.
Regards,
Ken
_______________________________________________
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