如何告诉mapCit已触及rightCalloutAccessoryView

Rap*_*eta 3 iphone mapkit iphone-sdk-3.0

我有一个MKAnnotationView被分配了一个DetailDisclosure按钮显示在注释的右侧.我怎么知道用户何时点击了注释按钮?这就是我的代码现在的样子 -

UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure];
pinView.rightCalloutAccessoryView = rightButton;
pinView.animatesDrop = YES;
Run Code Online (Sandbox Code Playgroud)

是否有内置方法来检测附件视图何时被触摸?我猜它会像UITableView方法,但我找不到任何东西.谢谢你的帮助.

Noa*_*oon 5

您需要将某个对象设置为地图视图delegate,并实现MKMapViewDelegate协议方法-mapView:annotationView:calloutAccessoryControlTapped:.