When is -applicationShouldOpenUntitledFile: invoked?
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.