0

I didn't find any reason behind making MKAnnotation as a protocol. Looking for answer.

As it seems like an Abstract class to me.

Thanks a bunch.

Zeeshan
  • 586
  • 7
  • 15
  • There is no direct concept of Abstract Class in Objective-C, so protocols is the answer to this.. see this thread, it might clear few questions http://stackoverflow.com/questions/1034373/creating-an-abstract-class-in-objective-c – iphonic Mar 26 '14 at 09:01

1 Answers1

0

Objective C does not have multiple inheritance.

Protocols allow implementation of a function(s) in classes that already have a different inheritance structure. Such as a protocol can be implemented by a ViewContoller, and often is. If MKAnnotation was an abstract class, the implementation of the functions would have to be in a class that inherits from MKAnnotation.

Cris
  • 464
  • 1
  • 3
  • 15
  • I am trying to understand the reason that why MKAnnotation is a Protocol only, why not just a NSObject class. – Zeeshan Mar 27 '14 at 09:17