14. Reference Counting

People who live in apartments often face a storage problem: They have more stuff than places to put stuff. Solving this problem requires shuffling possessions in and out of basement storage lockers and periodically going through the apartment and throwing out things that are no longer needed. Managing memory usage is the computer science equivalent of the apartment-dweller’s problem.

Memory management is important because memory is a limited resource. Although it is true that current computers can have amounts of physical memory that would have seemed like an intoxicated dream only a few years ago, the average program’s memory requirements and the users’ expectations have also increased. Keeping a program’s memory footprint ...

Get Learning Objective-C 2.0: A Hands-On Guide to Objective-C for Mac and iOS Developers 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.