Re: How to stop initial window ?
Re: How to stop initial window ?
- Subject: Re: How to stop initial window ?
- From: Curtis Laser <email@hidden>
- Date: Mon, 09 Jul 2001 11:40:51 -0600
This is the simplest way I have found:
Create a subclass of NSObject that will become the delegate of the
application. This subclass should be instantiated in MainMenu.nib. The
subclass has two methods. The first installs the object as the delegate when
it is pulled from the nib file:
- (void)awakeFromNib
{
[[NSApplication sharedApplication] setDelegate: self];
}
The second method is the only delegate method you have to implement:
- (BOOL)applicationOpenUntitledFile: (NSApplication *)theApplication
{
return YES;
}
You return YES telling the application that the delegate successfully opened
an empty document, when in reality you did nothing.
Anyone else have a better way?
Curtis Laser
on 7/9/01 8:47 AM, Paul Mix at email@hidden wrote:
>
At 8:48 PM -1000 7/6/01, Carlos Weber wrote:
>
> On Friday, July 6, 2001, at 01:12 PM, Finlay Dobbie wrote:
>
>
>
>> On Friday, July 6, 2001, at 08:07 pm, Robert Miller wrote:
>
>>
>
>>> I'm new to Cocoa and I'm working on a document based application
>
>>> starting from the basic editor application supplied with Apple's Cocoa
>
>>> Dev. seminar. This is probably a basic question but here goes. When I
>
>>> launch the application it automatically opens an empty window. I don't
>
>>> want it to do that, so how do I stop that behavior ? I haven't beena
>
>>> able to find anything in NSDocument or NSApplication relating to this.
>
>>> Any help is greatly appreciated.
>
>>
>
>> Having said that, there is probably a way of overriding the default
>
>> show, but hey, i'll let someone else tackle that (it's too late here).
>
>
>
> - (BOOL)applicationShouldOpenUntitledFile:(NSApplication *)sender
>
>
Just out of curiosity, how does this relate to the "Visible at launch
>
time" switch in IB's Attributes window Info-pane?
>
>
- Paul M
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev