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!

Comments

  1. Maniacdev says:

    Wow, nice screencast, hopefully I can someday get to this quality, great job.

  2. Anders Whe says:

    Hey, many thanks for these great great videos. The best memory tutorials i have seen round the net!

  3. 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.

  4. mike says:

    Great videos, thanks!

  5. Mike Lee says:

    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!!!

  6. Some Guy says:

    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.

  7. gord says:

    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.

  8. Netcob says:

    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).

  9. Carlos Lombardi says:

    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.

  10. MarkB says:

    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!

  11. Satya says:

    Great tutorials, thanks MARK.

  12. saebnajim says:

    Thank you , really useful information , please make other videos about objective-c and share them . these are nice

  13. GustavoB says:

    Crispy clear, great job, thank you

  14. WG says:

    Thanks! This is the clearest explanation I’ve seen yet.

  15. Ben Radler says:

    Wonderful tutorial Mark! It’s amazing how hard some of the information you give here can be to find in Apple’s infamous Docs.

  16. Dan Fordham says:

    Fantastic video tutorial, good job!

  17. Juliana says:

    Great tutorial! Thanks

Trackbacks

  1. [...] You can find the rest of the videos on Mark’s site at: Memory Management Basics Video Tutorial – Click Here [...]

  2. [...] Memory Management Basics Tutorial Video Always the bane of the iPhone developer’s existence, brush up on the basics of memory management for Objective-C. [...]

  3. [...] Memory Management Basics Tutorial Video | markjnet (tags: iphone_dev iphone_tutorial iphone_video_tutorial) [...]

  4. [...] When you creating objects by “alloc”, don’t forget to release it. But never don’t call dealloc derectly. For more information about memory management: Memory Management Basics Tutorial Video. [...]

  5. [...] Managements Basics tutorial video by Mark Johnson: http://www.markj.net/iphone-memory-management-tutorial-video/ September 11th, 2009 | Tags: app, apple, cocoa, iphone sdk, Objective-C, xcode | Category: [...]

Speak Your Mind

*