When to release a transient NSString StringWithFormat?

xiaoxiao2021-02-28  73

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.

转载请注明原文地址: https://www.6miu.com/read-84538.html

最新回复(0)