Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
While garbage collection is a far more elegant solution—neatly solving all three problems at once—it's a complex system, requiring significant resources, and has only recently matured. Pre-garbage collection Objective-C employed a simple alternative: reference counting.
Reference counting introduces the concept of owners: code or objects that hold a pointer to another object are said to own that object. When an object or block of code wants to hold a reference to an object, it first retains it. When it's done with the object, it releases it.