Re: Newbie question about deallocing?
Re: Newbie question about deallocing?
- Subject: Re: Newbie question about deallocing?
- From: j o a r <email@hidden>
- Date: Thu, 15 Jan 2004 17:41:53 +0100
The answer to this question can be found (several times) in the list
archives.
The basic idea is that since all resources used by the application will
be reclaimed in an efficient manner by the OS when the application is
quit, there is no reason to explicitly deallocate every single object
at this time.
If you need to perform specific actions when an object is removed, you
need to listen to the "app will terminate" notification (read the docs
for NSApplication).
j o a r
On 2004-01-15, at 17.22, Collin VanDyck wrote:
>
I've got a regular NSApplication built through XCode and Interface
>
Builder.
>
It is a Cocoa Application, and I have instantiated a subclass of
>
NSObject
>
(AppController) to act as the main controller for my application.
>
>
In my AppController.m file, I have the following method defined:
>
>
- (void) dealloc
>
{
>
NSLog(@"App Controller deallocating");
>
[_downloads release];
>
[_preferenceController release];
>
[super dealloc];
>
}
>
>
However, I never see this method called. "App Controller
>
deallocating" never
>
gets written to the console. I would expect that when I quit the
>
application
>
that my objects that I had instantiated through Interface Builder would
>
receive a dealloc method call.
>
>
I have my app controller acting as a delegate for File's Owner, but I
>
don't
>
think that would cause this issue.
>
>
Any ideas?
[demime 0.98b removed an attachment of type application/pkcs7-signature which had a name of smime.p7s]
_______________________________________________
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.