• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: dealloc not being called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: dealloc not being called?
      • From: "Erik M. Buck" <email@hidden>
References: 
 >dealloc not being called? (From: Dustin Mierau <email@hidden>)

  • Prev by Date: Re: dealloc not being called?
  • Next by Date: Re: 10.1 Changes
  • Previous by thread: Re: dealloc not being called?
  • Next by thread: Re: dealloc not being called?
  • Index(es):
    • Date
    • Thread