Does @”some text” give an autoreleased or retain 1 object back?

The NSString literal notation @”” gives you compile-time constant strings that reside in their own memory space and have constant addresses. Contrary to popular belief, the reason why you don’t release literal strings is not because they are part of the autorelease pool. They aren’t — instead, they spend the entire application’s lifetime in that … Read more

Why is autorelease especially dangerous/expensive for iPhone applications?

(cannot accept your own answer?) Well, after all that, I did manage to find a reference from Apple Developer, added as a side-note near the bottom of the page: iPhone OS Note: Because on iPhone OS an application executes in a more memory-constrained environment, the use of autorelease pools is discouraged in methods or blocks … Read more

How to find the cause of a malloc “double free” error?

When an object is “double-freed”, the most common cause is that you’re (unnecessarily) releasing an autoreleased object, and it is later autoreleased when the containing autorelease pool is emptied. I’ve found that the best way to track down the extra release is to use the NSZombieEnabled environment variable for the affected executable in Xcode. For … Read more