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.
I just started to develop an iphone app, and this is just what I needed! I knew about autorelease pools, but I didn’t know that convention. Makes a lot of sense, and I’m finally confident about memory management (I’m a Java programmer with some basic C/C++ knowledge).
IMHO this videos enjoy high quality from a didactical viewpoint, they know what they want to express, and they express it in a very clear way. My congratulations to the author.
This is a better explanation of memory management than I’ve seen in any text, including the most popular Objective-C and iPhone development books. Great job!
Great tutorials, thanks MARK.
Thank you , really useful information , please make other videos about objective-c and share them . these are nice
Crispy clear, great job, thank you
Thanks! This is the clearest explanation I’ve seen yet.
Wonderful tutorial Mark! It’s amazing how hard some of the information you give here can be to find in Apple’s infamous Docs.
Fantastic video tutorial, good job!
Great tutorial! Thanks