获取有关地图视图选定注释的信息
我在地图视图上有注释,并且每个标注上都有一个按钮。我需要做的是从这个标注中获取属性,即。标题,但记录这一行:
NSLog(@"%@", mapView.selectedAnnotations);
返回
这显然没有给我任何有用的信息...
我的问题是,如何访问所选注释标注的属性?
I have annotations on a mapview and a callout with a button on each. What I need to do is grab properties from this callout, ie. the title, but logging this line:
NSLog(@"%@", mapView.selectedAnnotations);
returns <AddressAnnotation: 0x1bdc60>
which obviously gives me no useful info...
My question is, how can I access the properties of a selected annotation callout?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
就是这样
This is how
这是我在annotationviewClick函数中所做的:
希望这有帮助
Here is what I did in the annotationviewClick function:
Hope this helps
mapView.selectedAnnotations
返回注释数组。您应该访问其项目以获取信息。mapView.selectedAnnotations
returns an array of anotations. You should access its items to get info.