- (void)dealloc {
[super dealloc];
[receivedData release]; receivedData = nil;
}
or
- (void)dealloc {
[receivedData release]; receivedData = nil;
[super dealloc];
}
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes, it absolutely maters when
[super dealloc]is called. Once[super dealloc]is called, you can no longer rely on theNSObject(or whatever your root class is) machinery to function properly. Afterall, your super-class’-deallocmethod should call its superclass’ etc. until the root class’-deallocmethod 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
-deallocmethod should always look like