3Memory Management

Understanding memory management in the Cocoa Touch framework is a major roadblock for newcomers. Unlike Objective-C on the Mac, Objective-C on iOS has no garbage collector. Thus, it is your responsibility to clean up after yourself.

Memory Management Basics

This book assumes you are coming from a C background, so the words pointer, allocate, and deallocate shouldn’t scare you. If your memory is a little fuzzy, here’s a review.

An iOS device has a limited amount of random access memory. Random access memory (RAM) is much faster to write to and read from than a hard drive, so when an application is executing, all of the memory it consumes is taken from RAM. When an operating system like iOS launches your application, it ...

Get iOS Programming: The Big Nerd Ranch Guide, Second 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.