When to release a transient NSString StringWithFormat?

来源:互联网 发布:mac终端返回上一级 编辑:程序博客网 时间:2024/06/14 11:00

From: http://stackoverflow.com/questions/5782256/when-to-release-a-transient-nsstring-stringwithformat

You don’t need to release it. Since stringWithFormat doesn’t start with alloc, init, new, copy, or mutableCopy, you’re not responsible for releasing it unless you’ve explicitly retained it.

When Instruments shows you a leak, it shows you where the leaked object was allocated, but not necessarily the code that’s actually causing the leak. I suspect you’re leakingmyDict, and thus all the objects inside it are leaked as well.

0 0