Objective-C AutoRelease Pool

While reference counting is not new to me, the Objective-C AutoRelease pool is still a little tricky to understand.

Most recently, I learned that the autorelease pool will last for the life (scope) of the method invoking the call to a method in which an object is allocated and autoreleased.

That means I don’t need to retain an autoreleased object I receive from a library function/method if I’m only going to use the object within the local scope of where I received it.

Loading...