I just simply release objects as such:
[myObj release];
I have seen others add:
[myObj release]; myObj = nil;
Is the latter more advantageous because now there will never be a reference to that pointer?
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.
It is just to make sure that other successive messages that might be send to
myObjdon’t throw an exceptions. Message send tonilare possible in Objective-C.Otherwise,
myObjstill points to the memory address where it has been and accessing it might result in aBAD_ACCESSerror.