Tewha Links and writings on software development, mostly for iPhone and Mac OS X.


Keeping optimal autorelease pools

Martin Pilkington on autorelease pools:

However, a problem arises when you're creating a lot of objects at once. The obvious solution is to initialise and release objects by hand in this case, but sometimes it isn't possible. A lot of objects returned by Cocoa methods are autoreleased (by convention any object returned by a class method (other than +new or +alloc) should be autoreleased).

This is a good practical example of autorelease pool manipulation, including numbers showing before and after.