• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSWindowController maddness!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: NSWindowController maddness!
      • From: j o a r <email@hidden>
    • Re: NSWindowController maddness!
      • From: mmalcolm crawford <email@hidden>
    • Re: NSWindowController maddness!
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: Make a NSThread fall asleep and awake it.
  • Next by Date: making tableview non sortable
  • Previous by thread: Re: Make a NSThread fall asleep and awake it.
  • Next by thread: Re: NSWindowController maddness!
  • Index(es):
    • Date
    • Thread