Coding in Objective-C 2.0 Episode 2: Memory Management

Posted in Operating Systems, Mobile on January 13, 2009

Coding in Objective-C 2.0 Episode 2: Memory Management

Objective-C 2.0 has a garbage collector, but it’s not available on the iPhone. So if you’re writing iPhone applications, you’ll need to manage your own memory. And it’s especially important on the iPhone, where resources are constrained, that you clean up after yourself. In this episode, we’ll find and fix various memory-management problems that are common in Objective-C programs. You’ll learn how to:

  • Manage memory wisely using retain, release, and autorelease
  • Apply object ownership rules
  • Understand how reference counting works
  • Track down over-release problems
  • Use Instruments to find and fix memory leaks
  • Clean up an object’s state in the dealloc method
  • Release and retain instance variables in setter methods
  • Use properties to ensure consistent memory management
  • When and how to autorelease objects using autorelease pools

Watch Video

Tags: OS, MacOS, Objective-C, iPhone, The Pragmatic Programmers, Xcode, Coding in Objective-C 2.0