Cocoa Programming for OS X: The Big Nerd Ranch Guide
by Aaron Hillegass, Adam Preble, Nate Chandler
What is ARC?
To understand ARC, you should know a little history. In the old days, Cocoa programmers managed their objects’ reference counts manually by “retaining” and “releasing” objects. There were rules, and the rules were fairly simple. This worked well.
Then garbage collection came to Cocoa in 2007. Garbage collection was fine, but it had awkward constraints on the contexts in which it could be used – it was all garbage collection or nothing.
A couple years later, Xcode 3.2 offered an exciting new feature: the Clang Static Analyzer, which knew the retain counting rules and could alert you to memory management errors in your code! Garbage collection never came to iOS. Instead, ARC was announced in 2011, and garbage collection ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access