Confused by notation?
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 so开发者_开发知识库mething I have seen before.
id <MKAnnotation> mp = [annotationView annotation];
many thanks
gary
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).
It tells you that the object returned will meet the protocol MKAnnotation
see Apple's objective-C concepts
精彩评论