Automatic Reference Counting

ARC eliminates all the potential pitfalls associated with manual reference counting. Under the hood, reference counts are still being maintained and tracked. However, the system determines when to retain an object and when to autorelease or release it. You don’t have to worry about it at all.

And you don’t have to worry about returning allocated objects from methods. The compiler figures out how that object’s memory needs to be managed by generating the correct code to autorelease or retain the returned object as necessary.

Get Programming in Objective-C, Sixth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.