R – Do I still need to learn about managing memory now that Objective-C/Cocoa has Garbage collection

cocoagarbage-collectionmacosobjective c

So I finally dusted off my Objective-C/Cocoa books.. turns out they are nearly 7 years old! With Objective-C 2.0 now having garbage collection, how important are the chapters on Memory Management?

How much of a difference has Garbage Collection made?

Best Answer

Memory management is still really important to understand. If you're targeting an older OS, you need to do memory management. If you're using an older library, you need to do memory management. If you drop down to the Core Foundation level, you (may or may not) need to do memory management.

If you're programming for iPhone, you need to do memory management.

The garbage collector in Objective-C is outstanding - and if you can be using it, you most definitely should be - but it just doesn't cover every programming situation yet.

Related Topic