我想在Mkmapview上实现搜索。我的意思是根据标题或副标题搜索所有注释引脚。
如果有任何办法,请告诉我。过去几天我一直在网上搜索。直到现在都没有线索。请告诉我。
提前感谢。
苏雷什
答案 0 :(得分:1)
试试这个:
for(MKAnnotation* currentAnnotation in yourMapView.annotations)
{
if([currentAnnotation.title isEqualToString:@"titleSearched"])
{
// currentAnnotation is the annotation you searched
}
}
答案 1 :(得分:0)
只需迭代MKMapView实例的annotations
ivar,看看它们是否匹配。