Re: dealloc not being called?
Re: dealloc not being called?
- Subject: Re: dealloc not being called?
- From: Andreas Monitzer <email@hidden>
- Date: Thu, 27 Sep 2001 22:15:49 +0200
On Thursday, September 27, 2001, at 09:26 , Dustin Mierau wrote:
I have an object that is created when my application is ran, from a nib
file. My awakeFromNib method is being called, my init method is being
called, but for some reason when i quit the app my dealloc method is not
being called.
Any ideas?
I looked at some examples from the example folder, and this seems to also
be the case for TextSizingExample Controller object. I put an NSLog in
the dealloc method and it never seems to be called.
I am kinda new to cocoa, so you are welcome to laugh at me ;)
I had the same problem when starting Cocoa. Objects not released by the
developer are never released, NSApplication doesn't care about that (since
cleanup at program quit is not necessary). It's a break with the paradigm
"don't release objects you haven't retained/copied/created", but they seem
to like it that way.
Usually the best way to handle it is to define applicationWillTerminate:
in NSApplication's delegate. Of course, when writing a preferences pane
you can't do that, so you're out of luck.
andy
--
Description forthcoming.