I am using the ‘analyze’ tool in xcode to check for potential leakages in my app.
I am getting the following warning as a result.

How do I resolve the potential leak shown above? “self.answerArray” is just an array I declared in my header file

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.
You’ve called
mutableCopyon the array (which returns a new array with a retain count of +1 – You own it), and you assign it to a property (which I assume is a strong/retain property) and you’re not releasing it. You’re leaking the memory.You should release
tempArrayafter assigning it to the property – and ensure the property is released in your class’deallocmethod.