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

When is -applicationShouldOpenUntitledFile: invoked?


  • Subject: When is -applicationShouldOpenUntitledFile: invoked?
  • From: Jeremy Dronfield <email@hidden>
  • Date: Tue, 1 Oct 2002 14:40:01 +0100

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.
-Jeremy

========================================
email@hidden // email@hidden
The Alchemy Pages:
- fractious fiction at http://freespace.virgin.net/jeremy.dronfield
========================================
_______________________________________________
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.

  • Follow-Ups:
    • Re: When is -applicationShouldOpenUntitledFile: invoked?
      • From: "Clark S. Cox III" <email@hidden>
  • Prev by Date: Re: Behavior of autoreleased window controller for closing window vs. app termination
  • Next by Date: Re: Newbie: NSTable Autosave name not conforming to NSCoding
  • Previous by thread: Re: Behavior of autoreleased window controller for closing window vs. app termination
  • Next by thread: Re: When is -applicationShouldOpenUntitledFile: invoked?
  • Index(es):
    • Date
    • Thread