• 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: When is -applicationShouldOpenUntitledFile: invoked?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: When is -applicationShouldOpenUntitledFile: invoked?


  • Subject: Re: When is -applicationShouldOpenUntitledFile: invoked?
  • From: "Clark S. Cox III" <email@hidden>
  • Date: Tue, 1 Oct 2002 10:20:18 -0400

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Tuesday, Oct 1, 2002, at 09:40 US/Eastern, Jeremy Dronfield wrote:

A slightly unusual request - I'd like to know why the method I'm using *doesn't* cause problems.

I've been overriding -applicationShouldOpenUntitledFile: in my doc-based applications in order to prevent them opening a new blank document when launching or activating (I find this behaviour irritating). I wasted some time casting around for conditions I could use, along the lines of,

return [NSApp onlyJustLaunched] ? NO : YES;

Then I gave up and had it return a flat NO. To my surprise it worked, and didn't interfere with opening a new document from the File menu. The documentation says simply that -applicationShouldOpenUntitledFile: is invoked "immediately before opening an untitled file". So, is it bypassed by FirstResponder's -newDocument: action method (in which case the documentation is misleading), or is it a bug, or am I simply exhibiting my lack of understanding of how the responder chain works? Whichever, I'd be grateful for an explanation.

-applicationShouldOpenUntitledFile: is only invoked when the *application* wants to open an untitled file (i.e. in response to launching, or a click in the dock), not when the NSDocumentController wants to (i.e. in response to the New menu item).

- -- http://homepage.mac.com/clarkcox3/
email@hidden
Clark S. Cox, III
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (Darwin)

iEYEARECAAYFAj2ZrycACgkQd6STocYT1xX8TACffwwZCz93aLW7ZJQmLmlI/hI9
rwQAn0E+UAk7erSeSMSwQ7f5//+tHZur
=Xzd7
-----END PGP SIGNATURE-----
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >When is -applicationShouldOpenUntitledFile: invoked? (From: Jeremy Dronfield <email@hidden>)

  • Prev by Date: Re: Newbie: NSTable Autosave name not conforming to NSCoding
  • Next by Date: Re: [newbie] Handling a preferences window
  • Previous by thread: When is -applicationShouldOpenUntitledFile: invoked?
  • Next by thread: Re: [newbie] Handling a preferences window
  • Index(es):
    • Date
    • Thread