- (void)dealloc {
[super dealloc];
[receivedData release]; receivedData = nil;
}
or
- (void)dealloc {
[receivedData release]; receivedData = nil;
[super dealloc];
}
Yes, it absolutely maters when [super dealloc]
is called. Once [super dealloc]
is called, you can no longer rely on the NSObject
(or whatever your root class is) machinery to function properly. Afterall, your super-class' -dealloc
method should call its superclass' etc. until the root class' -dealloc
method is called. At that point, everything that these classes allocate to do their job is potentially gone and you're in undefined territory if you try to use any of it.
Your -dealloc
method should always look like
- (void)dealloc
{
// release my own stuff first
[super dealloc];
}
Yes. Last. Always.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With