Memory Management Basics Tutorial Video
This article is a screen cast video of my tutorial for beginner iPhone programmers, it’s about the basics of memory management in Objective-C. Memory management is a tough nut for the beginner to crack, particularly in Objective-C and Cocoa for iPhone. Check out my iPhone memory management reading list for more voices on memory management.
The tutorial covers: Objective-C object retain counts; using retain, release, and autorelease; explains the autorelease pool in detail and how it works with the event loop; rule of thumb for if an object is in the autorelase pool.
Part 1: retain counts
Part 2: auto-release pool and the event loop
Part 3: auto-release pool and the event loop with retain
Part 4: auto-release pool wrap up
Part 5: properties, dealloc, bugs, auto-release rule of thumb
Thanks for watching!








Wow, nice screencast, hopefully I can someday get to this quality, great job.
Hey, many thanks for these great great videos. The best memory tutorials i have seen round the net!
Hey Mark, thanks for the awesome screencasts. I’ve been looking for an explanation of the basics of memory management like this for quite a while — great job! You explain things in a very clear, easy-to-understand way.
Great videos, thanks!
These are great videos. I have been pulling my hair out with memory management issues in an iPhone app an this really helped a TON!!!
A couple of notes on your “retain count” slide. The retain count doesn’t keep any kind of count of other objects, it just records how many -retain messages have been received. There’s nothing bidirectional here.
Secondly, it’s not correct to say that “objective-c” deletes the object from memory. NSObject’s -dealloc method does that, not the obj-c runtime.
Excellent series of videos – very well presented. Thanks. I just read Programming in Objective-C 2.0 by Kochan, and these videos really help to solidify the material I learned from the book.