I have a standard Cocoa project, just a Cocoa Application, not using CoreData and it's not document-based. For some reason, dealloc: is not getting called on my application controller object when the program quits normally (by selecting Quit from the File menu). My controller object is set as the application's delegate in the Nib, and I'm using Xcode 2.5 on Tiger, so I don't think it's a "garbage collection is turned on" thing. Everything else seems to be working (including awakeFromNib but I can't figure out why dealloc is not called. Here's the method:
Nothing shows up in the log and the log is working fine because I have NSLogs all over the place elsewhere in the same controller class.
EDIT: Is it because I instantiated this object in the Nib? Shouldn't all objects call dealloc: before they are destroyed? Do I need do all my cleanup in applicationWillTerminate: or something other than dealloc: in this case?
Code:
- (void)dealloc {
NSLog(@"***DEALLOCATING***");
if (pendingUploadFilePaths) [pendingUploadFilePaths release];
[context release];
[invoc release];
[super dealloc];
}
EDIT: Is it because I instantiated this object in the Nib? Shouldn't all objects call dealloc: before they are destroyed? Do I need do all my cleanup in applicationWillTerminate: or something other than dealloc: in this case?