I want to avoid to display a callout when I tap a MKAnnotation, just to display the pin, and when I tap, I want nothing happens.
Thanks
I want to avoid to display a callout when I tap a MKAnnotation, just to display the pin, and when I tap, I want nothing happens.
Thanks
Try like this .
- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation
{
MKPinAnnotationView *annView = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:@"sample"];
annView.canShowCallout = NO;
return annView;
}
Hope this code is useful for you.
This will help you.
-(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation
{
static NSString *reuseId = @"pin";
MKPinAnnotationView *pinV = (MKPinAnnotationView *)[mapView dequeueReusableAnnotationViewWithIdentifier:reuseId];
if (pinV == nil)
{
pinV = [[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:reuseId];
pinV.canShowCallout = NO; // You have to add this.
}
return pinV;
}