2012-11-16 77 views
0

我要检查如果单击批注: 如此这般从这个:检查注释标注点击

Not clicked yet

要:

To clicked

这里是我的代码,显示注释:

- (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { 
static NSString *identifier = @"MyLocation"; 

if ([annotation isKindOfClass:[MyLocation class]]) { 


    MKAnnotationView *annotationView = (MKAnnotationView *) [_mapView dequeueReusableAnnotationViewWithIdentifier:identifier]; 

    if (annotationView == nil) { 
     annotationView = [[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier:identifier]; 
     annotationView.enabled = YES; 
     annotationView.canShowCallout = YES; 
     annotationView.image = [UIImage imageNamed:@"arrest.png"];//here we use a nice image instead of the default pins 
     annotationView.rightCalloutAccessoryView = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; 


    } else { 
     annotationView.annotation = annotation; 

    } 

    return annotationView; 

} 

return nil; 

}

rightCalloutAccesoryView是标注内的蓝色按钮。但是当用户点击注释时我需要隐藏一些东西。

有谁知道如何检查这个/做到这一点?

谢谢你是进步

回答

3
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view { 
//do your code 
}