Since MKAnnotation is a protocol, you will need to define your own class that implements the protocol. For example,
@interface SPAnnotation : NSObject <MKAnnotation> { CLLocationCoordinate2D coordinate; } @property (nonatomic, readonly) CLLocationCoordinate2D coordinate; - (id)initWithCoordinate:(CLLocationCoordinate2D)coordinate;
If you have latitude, longitude for the location you want to display:
SPAnnotation *annotation = [[Annotation alloc] initWithCoordinate:CLLocationCoordinate2DMake(latitude, longitude)]; [myMap addAnnotation:annotation];
Stephen poletto
source share