如何检测 MKAnnotation 何时被点击
我有一个地图视图,它显示许多引脚(MKAnnotation 对象)。我想通过点击(单击)来获取每个引脚的详细信息。请参考一些教程或提供一些示例代码。提前致谢。
i have a mapView, which shows many pins (MKAnnotation objects). i want to get the detail of each pin by tapping (clicking ) on it. please refer me to some tutorials or provide some sample code. thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果正确实现 MKAnnotation 协议,点击应该自动显示“标题”和“副标题”成员,即不需要任何额外的编码。
看看我刚刚创建的 Speedy 的 MKMapView 示例,或者直接下载它位于此处。
有关获得委托点击的更多信息,请查看此帖子
If you implement the MKAnnotation protocol correctly, tapping should display the "title" and "subtitle" members automatically, i.e. without the need for any additional coding.
Take a look at this MKMapView sample for Speedy I just created, or simply download it here.
For further information about getting the click to your delegate take a look at this post