详细信息披露后的注释细节? [英] Annotation details after detail disclosure pressed?

查看:129
本文介绍了详细信息披露后的注释细节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MKMapView注释对象,它有一个正确的标注附件详细信息公开按钮。当按钮被按下时,我使用addTarget:action:forControlEvent调用一个选择器方法,创建一个详细的viewController并将它推送到视图堆栈。

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.

我的问题是什么是访问启动callout detail控制器的注释信息的最佳方式。详细信息按钮设置为调用:

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 {
}



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.

这篇关于详细信息披露后的注释细节?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆