Let’s say I created an NSMutableDictionary object by using the following:
NSMutableDictionary* dictionary = [NSMutableDictionary dictionary];
When should I release this object? Do I call retain when passing it to other methods?
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.
1) you don’t need to release an autoreleased object (which is the
NSDictionaryobject returned by thedictionarymethod…)2) if you’re using ARC, you don’t need to even care about retaining or releasing.