NSWindowController maddness!
NSWindowController maddness!
- Subject: NSWindowController maddness!
- From: Todd Freese <email@hidden>
- Date: Tue, 09 Nov 2004 09:21:09 -0600
Title: NSWindowController maddness!
I have doc style application using bindings. I created an AppController to handle creating an NSWindowController to handle a non-doc style window, which uses a timer for updating.
When I close this window, the NSWindowController never gets released. The nib is set to “release on close” and the window is singleton. I have confirmed that windowWillClose is getting called.
Here is my AppController code:
- (IBAction)showVideoWindow:(id)sender
{
if (!videoWindowController) {
videoWindowController = [[VideoWindowController alloc] init];
}
[videoWindowController showWindow:self];
}
And my windowController code:
- (id)init
{
self = [super initWithWindowNibName:@"Video"];
return self;
}
- (void)dealloc
{
[super dealloc];
}
- (void)windowDidLoad
{
[NSThread detachNewThreadSelector:@selector(startRS422Thread) toTarget:self withObject:nil]; // Startup timer to window update.
}
- (void)windowWillClose:(NSNotification *)aNotification
{
[rs422Controller killTimer]; //Stop the timer.
[rs422Controller release];
NSWindowController *theWindowController = [[aNotification object] delegate];
[[theWindowController retain] autorelease];
}
The code for autoreleasing the NSWindowController in the windowWillClose method was lifted from a posting.
What am I missing here?
Todd Freese
The Filmworkers Club
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden