views:

30

answers:

2

Would someone be so kind as to explain what is happening with the statement below. I an a bit puzzeled by <MKAnnotation> between id and mp, it not something I have seen before.

id <MKAnnotation> mp = [annotationView annotation];

many thanks

gary

+2  A: 
id <MKAnnotation> mp

means that mp object is expected to conform to MKAnnotation protocol (and I suppose assignments you make to that objects will be checked at compile time whenever possible).

Vladimir
+1  A: 

It tells you that the object returned will meet the protocol MKAnnotation

see Apple's objective-C concepts

Mark