Another dealloc question


#1

if we override the dealloc method, with this:

- (void)dealloc { NSLog(@"deallocating %@", self); }
shouldn’t we call the dealloc from the super before or after the NSLog? this way -from what I’ve understood about overriding- you replace the dealloc method by the new method, and does nothing but an NSLog?!


#2

Before ARC, we had to call [super dealloc], but ARC takes care of that for us.


#3

Sorry to bump this, I also had the same question… I’m not yet finished with the book, but are there also other methods that automatically are called for the super, like init maybe, when they are overridden? Is there a good Apple documentation page for all the things ARC does for you somewhere?

Thanks!


#4

ARC really just frees us from needing to count out the references ourselves. So no more retains, releases, or deallocs.

For things that aren’t automatic, like init, you still need to call them on your own.

Apple has a good overview here developer.apple.com/library/mac/ … index.html