On 16 October 2010 10:41, Hrishikesh Murukkathampoondi <[email protected]>wrote:
> > mySecondWin = [[MyWinController alloc] initWithWindowNibName:@ > "MySecondWindow"]; > You get an instance of your window controller class: mySecondWinController = [[MyWinController alloc] initWithWindowNibName:@ "MySecondWindow"]; How do I release the memory once the window is closed? The description above > says that the window is kept in memory even if closed. > The owner of the controller should release the controller when the window is closed. You may want to register the owner to be notified (see NSWindowWillCloseNotification) when the window is being closed, and then autorelease the window controller. Alternatively, in your window controller, implement -(void)windowWillClose:(NSNotification*)notification, and do [self autorelease]. See http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Documents/Concepts/WindowClosingBehav.html /Dado _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
