在iOS 7中限制地图上的注释

时间:2015-03-26 17:15:28

标签: swift ios7 ios8 mapkit

我使用此代码创建了100个注释:

CLGeocoder().geocodeAddressString("Trieste, Via Svevo", completionHandler: {(placemarks, error)->Void in
  if error == nil {
    placemark = placemarks[0] as CLPlacemark

    self.puntoCercato2.coordinate = placemark.location.coordinate
    self.puntoCercato2.title = "Fermata di Via Svevo"
    self.puntoCercato2.subtitle = "1-8-29-B"
    self.myMap.addAnnotation(self.puntoCercato2)

  }else{
    println("2")
  }
})

iOS 8所有引脚都显示为[1]:http://i.stack.imgur.com/eh8Le.jpg

iOS 7只有前50 [2]:http://i.stack.imgur.com/g8m7j.jpg

为什么?

1 个答案:

答案 0 :(得分:0)

我认为我们需要更多代码来了解那里的问题。请使用有关CLPlaceMarks的更多详细信息编辑您的问题。 在已发布的代码段中,您只添加了一个地标,即地标数组的第0个位置。 你如何创建阵列?