Deallocation in Cocoa [greenhorn]
Deallocation in Cocoa [greenhorn]
- Subject: Deallocation in Cocoa [greenhorn]
- From: Maksymilian Wojakowski <email@hidden>
- Date: Mon, 21 Oct 2002 13:43:30 +0200
In nearly all tutorials introducing to Cocoa programming a new controller
class (myControler as sublcass of NSObject) is created and instantiated in
the MainMenu nib file.
So I created such controller class in my application. In the dealloc method
I put statment:
NSLog(@"myController dealloc");
The problem is, the dealloc method is not executed, when the application
quits. As a workaround I made myContoller class the delegate of the
application and in method (not mentioned in tutorials):
- (void)applicationWillTerminate:(NSNotification *)aNotification
I put statement:
[self release];
As the result, the dealloc method is launched when the app quits. Is it the
proper way to deallocate the main Controller?
--
Maksymilian Wojakowski
mailto:email@hidden
Stettin - Poland - Central Europe
Visit my homepage: <
http://homepage.mac.com/maxwoj/>
_______________________________________________
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.