O'Reilly logo

Effective Objective-C 2.0: 52 Specific Ways to Improve Your iOS and OS X Programs by Matt Galloway

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

5. Memory Management

Memory management is an important concept in any object-oriented language, such as Objective-C. Understanding the specifics of any language’s memory-management model is vital to being able to write memory-efficient, bug-free code.

Once you understand the rules, memory management in Objective-C is not complicated and was made easier when Automatic Reference Counting (ARC) came along. ARC diverts nearly all the memory-management decisions to the compiler, leaving you to concentrate on the business logic.

Item 29: Understand Reference Counting

Objective-C uses reference counting for memory management, meaning that every object has a counter that is incremented and decremented. You increment the counter when you want to register ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required