我有一个 MKMapView 注释对象,它有一个正确的标注附件详细信息披露按钮.当按钮被按下时,我使用 addTarget:action:forControlEvent 来调用一个选择器方法,该方法创建一个细节视图控制器并将其推送到视图堆栈上.
I have a MKMapView annotation object that has a right callout accessory detail disclosure button. When the button is pressed I am using addTarget:action:forControlEvent to call a selector method which creates a detail viewController and pushes it onto the view stack.
我的问题是访问启动标注详细信息控制器的注释信息的最佳方式是什么.详细信息披露按钮设置为调用:
My question is what is the best way to access the information on the annotation that initiated the callout detail controller. The detail disclosure button is set to call:
[button addTarget:self action:@selector(disclosurePressed:) forControlEvents:UIControlEventTouchUpInside];看起来像这样:
- (void)disclosurePressed:(id)sender { }我想我可以寻找发件人 UIButton 的父注释,谁能给我任何关于如何最好地完成的指示.
I guess I could look for the parent annotation of the sender UIButton, can anyone give me any pointers to how this is best done.
推荐答案您可能更容易使用 MKMapViewDelegate mapView:annotationView:calloutAccessoryControlTapped: 方法,它告诉直接点击哪个注释视图.
You might have an easier time using the MKMapViewDelegate mapView:annotationView:calloutAccessoryControlTapped: method, which tells you directly which annotation view was tapped.
更多推荐
按下细节披露后的注释细节?
发布评论