When to release a NSString in iPhone
up vote 7down votefavorite 7 share [fb]share [tw] |
I have the following method
I am not releasing the aPais, because if I do it the application crashes. I don't know when or if whether I should release it somewhere after using it and, if so, how do I do it. Just release the NSMutableArray is enough? Or do I have to traverse it and release each object? And if I don't have to release it, who is the responsible for releasing?
|
|||
feedback |
2 Answers
up vote 6 down voteaccepted |
As epatel said, you don't need to release that particular string. If you wanted to be more proactive, you could do this instead:
In summary:
-- Edit: Added
|
|||
feedback |
up vote 4down vote |
|
||
Was this post useful to you? |
欢迎加群互相学习,共同进步。QQ群:iOS: 58099570 | Android: 330987132 | Go:217696290 | Python:336880185 | 做人要厚道,转载请注明出处!http://www.cnblogs.com/sunshine-anycall/archive/2011/10/21/2219738.html