Chapter 11. Memory Management

Perhaps one of the most frustrating aspects of Objective-C in years past was memory management. In the early days, memory management involved manual reference counting—the explicit act of indicating your intention to retain a reference to an object and then release it when you were finished.

Although Apple dabbled with garbage collection in OS X development for a while, reference counting was the only means of memory management for iOS, and it remained popular on OS X. Eventually, automatic reference counting (ARC) was introduced to Objective-C, and although the underlying process was the same, the hard work of deciding when and where to retain and release objects was performed mainly by the compiler rather than ...

Get Swift Translation Guide for Objective-C Users: Develop and Design 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.