Re: Preventing Document-Based App from opening new doc when opened
Re: Preventing Document-Based App from opening new doc when opened
- Subject: Re: Preventing Document-Based App from opening new doc when opened
- From: Donald Brown <email@hidden>
- Date: Thu, 08 Nov 2001 21:01:56 -0600
I've been searching, and one thing I'm unclear on. Is
-applicationShouldOpenUntitledFile called when the user chooses "New" from
the File Menu? So, if I want to do something different on startup (opening
a file that the user has said "open at startup"), do I have to figure out
why the app is trying to open the untitled file?
Donald
on 11/8/2001 5:41 PM, Erik M. Buck at email@hidden wrote:
>
> My document based app keeps opening a brand new blank document whenever it
>
> is opened, or if there is no document open, it will make a new one when
>
> switching to it. Is there any way to prevent this from happening?
>
> _______________________________________________
>
>
This is the required behavior according to Apple's guidelines. However, see
>
applicationShouldOpenUntitledFile:
>
- (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
>
>
Invoked immediately before opening an untitled file. Return NO to prevent
>
the application from opening an untitled file; return YES, otherwise. Note
>
that applicationOpenUntitledFile: is invoked if this method returns YES.
>
----------------------------------------------------------------------------
>
----
>
>
This question is asked way too many times. Please do a google search before
>
posting to this forum.
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
--
Donald Brown
email@hidden
http://www.eamontales.com
We have met the enemy and he is us - Pogo