MKMapView:获取注释引脚上的点击事件 [英] MKMapView: Get clicked event on annotation pin
问题描述
我使用的是包含两个 MKAnnotation
引脚的 MKMapView
。
map我显示了一个 UITableView
,其中包含 MKAnnotation
的详细信息。
I am using an MKMapView
containing a couple of MKAnnotation
pins.
Above the map I am showing a UITableView
with detailed information of the MKAnnotation
pins.
我的问题:当我选择一个引脚,我想选择相应的表单元格。
对于这个,我想捕获一个事件/委托,如果该引脚被选中。我不在说调用callout附件
My problem: When I select a pin, I would like to select the corresponding table cell. For this I would like to catch an event/delegate if the pin is selected. I am not talking about calling the callout accessory
- (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control
推荐答案
在iOS 4中有MKMapViewDelegate方法可以用来跟踪注释的选择和取消选择:
Just an update to this -- in iOS 4 there are MKMapViewDelegate methods that can be used to track annotation selection and de-selection:
- (void)mapView:(MKMapView *)mapView didSelectAnnotationView:(MKAnnotationView *)view
- (void)mapView:(MKMapView *)mapView didDeselectAnnotationView:(MKAnnotationView *)view
这篇关于MKMapView:获取注释引脚上的点击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!