我有一个地图视图上的注释和一个标注,每个标注上都有一个按钮。我需要做的是从这个标注中抓取属性,即。标题,但记录下面这行:
NSLog(@"%@", mapView.selectedAnnotations);
返回<AddressAnnotation: 0x1bdc60>
,它显然没有给我任何有用的信息...
我的问题是,如何访问所选注释标注的属性?
发布于 2011-02-26 00:28:06
这就是为什么
for (id annotation in mapView.annotations) {NSLog([annotation title]);}
发布于 2011-03-16 07:24:18
下面是我在annotationviewClick函数中执行的操作:
希望这能有所帮助
-(IBAction) annotationViewClick:(id) sender{
[self.view addSubview:LoadingView];
Annotation *ann = [myMap.selectedAnnotations objectAtIndex:([myMap.selectedAnnotations count]-1)];
NSLog(@"Selected:%@", [ann tag]);
}
发布于 2009-11-19 19:44:24
mapView.selectedAnnotations
返回一个anotations数组。你应该访问它的项目来获取信息。
https://stackoverflow.com/questions/1722820
复制相似问题