Objective-C Language Protocols and Delegates

30% OFF - 9th Anniversary discount on Entity Framework Extensions until December 15 with code: ZZZANNIVERSARY9

Remarks

Protocols and Delegates are two related but different concept:

A Protocol is a interface a class can conforms to, meaning that class implements the listed methods.

A Delegate is typically an anonymous object that conforms to a protocol.

The application of Delegate called Delegation is a design pattern.

At one end we have the concept of Inheritance which creates a tight coupling between the subclass and its superclass whereas Delegation design pattern provides an alternative to avoid this tight coupling using which we can create a much looser relationship based on anonymous Delegate objects.



Got any Objective-C Language Question?