I tried to use BarButton but this is wrong:
CGSize thumbSize = CGSizeMake(30.0, 30.0);
UIImageView *annotationThumbnail = [[UIImageView alloc] initWithImage:[((Sight *)annotation).thumbnail imageToFitSize:thumbSize method:MGImageResizeScale]];
UIBarButtonItem *annotationButton = [[UIBarButtonItem alloc] initWithCustomView:annotationThumbnail];
annotationView.leftCalloutAccessoryView = annotationButton;
UIBarButtonItemis not a subclass of UIView, so using an instance ofUIBarButtonItemin a place that expects a view isn’t going to work. Instead, you could just useannotationThumbnaillike this:If you instead use a UIControl subclass, like UIButton, map’s delegate will get a
-mapView:annotationView:calloutAccessoryControlTapped:message if someone taps the callout accessory: