Re: NSWindowController problem
Re: NSWindowController problem
- Subject: Re: NSWindowController problem
- From: Jörn Salewski <email@hidden>
- Date: Sat, 10 Jan 2004 05:30:31 +0100
Right now I can not find where - (void)windowDidClose:(NSNotification
*)notification should be defined. Where did you find it?
However, - (void)windowWillClose:(NSNotification *)notification is defined
as a delegate method in NSWindow. So, I would try (perhaps in the subclasses
implementation of windowDidLoad):
[[self window] setDelegate:self];
and then implement windowWillClose.
Yours,
Joern Salewski
am 10.01.2004 0:34 Uhr schrieb Daniele unter email@hidden:
>
hello i have subclassed an NSWIndowControllerClass. I have implemented
>
the windowDidLoad: method and it works correctly. Now i haven't found
>
any equivalent method for close. The only available is windowDidClose
>
but it not works.What's the correct method? (i need to release the
>
instance of created window)
>
>
this is my code for NSWindowController subclass:
>
>
@implementation COMPostWindow
>
>
- (id) init {
>
if (self) [super initWithWindowNibName:@"NewPost"];
>
return self;
>
}
>
>
- (void) windowWillLoad {
>
NSLog(@"LOADED");
>
}
>
>
- (void)windowDidClose:(NSNotification *)notification
>
{
>
NSLog(@"CLOSED");
>
if([notification object] == [self window])
>
[self autorelease];
>
}
>
>
- (void)dealloc
>
{
>
NSLog(@"Dealloc");
>
[super dealloc];
>
}
>
>
>
To open the windo I use:
>
>
COMPostWindow *s = [[COMPostWindow alloc] init];
>
[s showWindow:nil];
>
_______________________________________________
>
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.
_______________________________________________
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.