Just wondering, does anyone know what is different between the Objective C 2.0 garbage collector and the new automatic link counter in the iOS 5 SDK?
ARC is not a garbage collector. Itβs better to think of it as a call to manually count the links (save / release / autoload) that are added by the compiler. It also uses some tricks at runtime.
If you are completely new to ObjC on Apple systems: all types of Apple Objective-C use reference counting, but now there are several options. Before ARC and before GC, all we used was manual reference counting (MRC). With MRC, you explicitly save and free your objects. MRC was difficult for some people, especially those who spent little time managing their memory. Therefore, the demand for simpler systems has increased over time. MRC programs also require you to write good memory management code, which can become tedious.
See Brad for an excellent answer here for more details.
Does iOS 5 SDK also use Objective-C 2.0?
Yes, but the ObjC Garbage Collector is not and has never been an option in iOS.
justin
source share