• 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: single-document application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: single-document application


  • Subject: Re: single-document application
  • From: Uli Kusterer <email@hidden>
  • Date: Thu, 30 Mar 2006 11:12:32 +0200

Am 30.03.2006 um 08:49 schrieb desktoast music productions:
How do I tell my multi-doc app to open with a specific document whenever
launched?

I suppose you still want it to open the requested document if the user double-clicked a document, right?


The "safe" way would be to go Carbon and handle the "oapp" Apple Event. This event is only sent when your app was opened without a document.

The chicken's way out would be to do a delayed performSelector: that opens your other document on applicationDidFinishLaunching and to cancel the perform whenever a document is opened. Of course if the machine is under a lot of load, your delay may elapse even though the user requested to open a document, and you'll add to the load by unnecessarily opening the old document and the one that was double- clicked.

Actually opening the document is fairly simple IIRC. Just as the NSDocumentController to do that.

Wonder if I should’ve started out with a not document-based app?

No.

Cheers,
-- M. Uli Kusterer
http://www.zathras.de


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >single-document application (From: desktoast music productions <email@hidden>)

  • Prev by Date: Handling menu actions in doc-based apps
  • Next by Date: Re: Handling menu actions in doc-based apps
  • Previous by thread: single-document application
  • Next by thread: Handling menu actions in doc-based apps
  • Index(es):
    • Date
    • Thread