按下细节披露后的注释细节?

编程入门 行业动态 更新时间:2024-10-25 16:21:25
本文介绍了按下细节披露后的注释细节?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有一个 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.

更多推荐

按下细节披露后的注释细节?

本文发布于:2023-11-23 01:45:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1619662.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:细节   按下   注释

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!