6 ms·
This document helped me out a bit: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html http://developer.apple.com/documentation
by yan 18y ago
This document helped me out a bit: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/MemoryMgmt.html http://developer.apple.com/documentation/Cocoa/Conceptual/Me...
Also, this has a few rules you can follow: http://www.stepwise.com/Articles/Technical/2001-03-11.01.html http://www.stepwise.com/Articles/Technical/2001-03-11.01.htm...
Just remember that adding elements to containers bumps their retain counts. So the following is a common pattern for me:
MyClass *c = [[MyClass alloc] init];
[arr addObject:c];
[c release];
If you're returning an object from a method, you probably want to autorelease it.