Objective-C Protocols.


Please explain why do you think this question should be reported?

Report Cancel

Objective-C allows you to define protocols, which declare the methods expected to be used for a particular situation. Protocols are implemented in the classes conforming to the protocol.

A simple example would be a network URL handling class, it will have a protocol with methods like processCompleted delegate method that intimates the calling class once the network URL fetching operation is over.

A syntax of protocol is shown below.

@protocol ProtocolName
// list of required methods
// list of optional methods
Please follow and like us:

About the Author