Re: How to completely release every object allocated when opening a NIB file ?
Re: How to completely release every object allocated when opening a NIB file ?
- Subject: Re: How to completely release every object allocated when opening a NIB file ?
- From: Charles Srstka <email@hidden>
- Date: Wed, 14 Jan 2004 03:22:39 -0600
On Jan 14, 2004, at 2:27 AM, mmalcolm crawford wrote:
- (IBAction)makeNewWindow:(id)sender
{
MyWindowController *wc = [[MyWindowController alloc] init];
[windowsArray addObject:wc];
[wc release];
[wc showWindow:nil];
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(wcWindowClosed:)
name:NSWindowWillCloseNotification
object:[wc window]];
}
- (void)wcWindowClosed:(NSNotification *)note
{
MyWindowController *wc = [[note object] delegate];
[windowsArray removeObject:wc];
}
(You'd override windowNibName in MyWindowController
- (NSString *)windowNibName
{
return @"MyWindow";
}
)
I don't get it. Why not just call -[NSWindowController
initWithWindowNibName:] instead of subclassing it to override
windowNibName?
Charles
_______________________________________________
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.