Help : Releasing NSWindowController object ?
Help : Releasing NSWindowController object ?
- Subject: Help : Releasing NSWindowController object ?
- From: "K.K.Chan" <email@hidden>
- Date: Tue, 4 Jun 2002 14:22:03 +0800
Hello,
I have ask this question before, but get no reply.
I just want to know, is it safe to release NSWindowController subclass
object ?
As far as I know, after object loads a nib, it should not be release.
Now I am
not sure.
Thanks.
K.K.Chan
// call from main nib
- (IBAction)openPref:(id)sender
{
NSAutoreleasePool *pool;
id aWindow;
pool = [[NSAutoreleasePool alloc] init];
aWindow = [[PrefController singleInstance] window];
if ( aWindow )
[NSApp runModalForWindow: aWindow];
[pool release];
}
// @interface PrefController : NSWindowController
@implementation PrefController
- (id) initWithWindowNibName: (NSString *) windowNibName
{
self = [super initWithWindowNibName: windowNibName];
return self;
}
- (void) windowWillClose: (NSNotification *) theNotification
{
[self autorelease]; // <=== is this safe ?
singleInstance = nil;
[NSApp stopModal];
}
_______________________________________________
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.