Memory Management

It used to be that memory management was one of the most challenging aspects of learning Objective-C. Fortunately, that is no longer the case because Apple has introduced a system called Automatic Reference Counting (ARC) that hides most of the complexity of memory management. However, although you don’t need to know all the intricacies of managing memory in your apps, it’s still important to understand what’s going on and how it works.

In object-oriented programming, it’s always a problem to reclaim the memory left behind when all references to an object are removed. For instance, imagine you create two objects and assign them to variables a and b, respectively. But then later, you assign variable a to point to variable b. ...

Get Learning Mobile App Development: A Hands-on Guide to Building Apps with iOS and Android 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.