When i have a NSMutableArray with some custom class objects, declared
NSMutableArray *list = [NSMutableArray new];
Must i also release all the objects in *list?
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.
Putting an object reference into a
NSMutableArraywill make the retain count for that object incremented, because the array retains every object.When sending the
releasemessage to the array, it also send the same message to all the objects it references.So in case you didn’t retain them over the array, you shouldn’t do anything more.