• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Launching a document-based app with no document
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Launching a document-based app with no document
      • From: Dylan McNamee <email@hidden>
References: 
 >Launching a document-based app with no document (From: Dylan McNamee <email@hidden>)

  • Prev by Date: Re: Alert dialog in agent app?
  • Next by Date: Get error message about registered observers when Object receives dealloc message
  • Previous by thread: Launching a document-based app with no document
  • Next by thread: Re: Launching a document-based app with no document
  • Index(es):
    • Date
    • Thread