0

好的,我有一系列酒吧:

var pubs = [Pub(coordinate: CLLocationCoordinate2D(latitude: 43.2282385, longitude: 76.855085)),
    Pub(coordinate: CLLocationCoordinate2D(latitude: 43.2345965, longitude: 76.8907758)).

我在我的地图上添加注释:

mapView.addAnnotations(pubs).

然后我以这种方式选择第一个注释:

mapView.selectAnnotation(mapView.annotations.first!, animated: true)

但现在它首先显示选定的注释,然后显示第二个。

问题:如何在注解中先设置需要的注解?

谢谢。

4

1 回答 1

0

Howe 说@ogres:mapView可能会重新排列 的数组Pubs,所以我不得不从TableView-s 数组中选择它mapView.selectAnnotation(tableView.annotations.first!, animated: true)

于 2015-12-21T07:22:54.913 回答