Re: Loading a Nib file
Re: Loading a Nib file
- Subject: Re: Loading a Nib file
- From: Dado Colussi <email@hidden>
- Date: Sat, 16 Oct 2010 11:29:09 -0500
On 16 October 2010 10:41, Hrishikesh Murukkathampoondi <email@hidden>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@hidden)
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:
This email sent to email@hidden