Objective-C Protocols.

Report
Question
30 views

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
@required
// list of required methods
@optional
// list of optional methods
@end
Please follow and like us:

About the Author