Protocols provide language support for the reuse of design, whereas classes support the reuse of code. Well designed protocols can help users of an application framework when learning or designing new classes. MyClass inherits from Object and conforms to the Archiving protocol. Protocols also provide better type checking without compromising the flexibility of untyped, dynamically bound objects. Currently, there are a number of implementations of garbage collection which can be used in Objective-C programs.
Most methods use very different approaches.
Cyclic Referencing Straightforward reference counting, where an object decides to deallocate itself only upon reaching a reference count of 0, introduces the problem of cyclic referencing. This problem can be alleviated by introducing the notion of ownership. The object goes about releasing all its instance variables and sits around waiting for the final release which will cause its deallocation. Because the object releases all things it has retained, it is guaranteed that the object will not end up being part of an unreferenced cycle.