• 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: nsdocument/nsapp delegate question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: nsdocument/nsapp delegate question


  • Subject: Re: nsdocument/nsapp delegate question
  • From: "John C. Randolph" <email@hidden>
  • Date: Mon, 1 Oct 2001 22:45:38 -0700

On Monday, October 1, 2001, at 09:54 PM, Alex Rice wrote:

Hi, I have Cocoa design problem I need some advice around. I would like my NSDocument app to do something like this- in pseudo code:

if launched via app icon
if user preference, open previous document
else create untitled doc
else if launched via a saved document
open only that document

Where I'm stuck is that I need find out in applicationWillFinishLaunching: whether or not the app was launched via a document or via the app. But, application:openFile: is not sent until after applicationWillFinishLaunching: and by the time applicationDidFinishLaunching: is sent, there is already an untitled document opened automatically. How else can I check how the app was launched via a document?

I think you can get the behaviour you describe just by implementing -applicationShouldOpenUntitledFile: in your app delegate. That shouldn't get called until the app is finished launching.

-jcr



"I fear all we have done is to awaken a sleeping giant and fill him with a terrible resolve." -Admiral Isoroku Yamamoto, Dec 7, 1941.


  • Follow-Ups:
    • Re: nsdocument/nsapp delegate question
      • From: Alex Rice <email@hidden>
References: 
 >nsdocument/nsapp delegate question (From: Alex Rice <email@hidden>)

  • Prev by Date: nsdocument/nsapp delegate question
  • Next by Date: Re: NSWindow hax0r
  • Previous by thread: nsdocument/nsapp delegate question
  • Next by thread: Re: nsdocument/nsapp delegate question
  • Index(es):
    • Date
    • Thread