
I have already posted one answer with different style annotation. But, if you want shown annotation as in above image, you have to use leftCalloutAccessoryView property of MKAnnotationView class as below:
-> First, create pinAnnotation and add it to mapView in viewDidLoad or where you created mapView:
// Add the annotation to our map view
MKPointAnnotation * pointAnnotation = [[MKPointAnnotation alloc] init];
pointAnnotation.title = @"Rakesh Thummar";
pointAnnotation.subtitle = @"Ahmedabad";
pointAnnotation.coordinate = coord;
[mapView addAnnotation:pointAnnotation];
-> Then, use leftCalloutAccessoryView property of MKAnnotationView class:
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
static NSString *annotationViewReuseIdentifier = @"annotationViewReuseIdentifier";
MKAnnotationView *annotationView = (MKAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:annotationViewReuseIdentifier];
if (annotationView == nil) {
// if you want to show pinPoint create object of MKPinAnnotationView class instead of MKAnnotationView class
annotationView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:annotationViewReuseIdentifier];
}
annotationView.canShowCallout = YES;
// Add a custom image to the left side of the callout.
UIImageView *myCustomImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"photo1_40.png"]];
annotationView.leftCalloutAccessoryView = myCustomImage;
return annotationView;
}