我使用了在 swift 1.0 中工作的函数 geocodeAddressString,但在 swift2 中没有。谁能告诉我我的代码有什么问题以及如何解决这个问题?谢谢!
geocoder.geocodeAddressString(address, {(placemarks: [AnyObject], error: NSError) -> Void in //Error: Missing argument for parameter 'completionHandler' in call
if let placemark = placemarks?[0] as? CLPlacemark {
let annotation = MKPointAnnotation()
let location:CLLocationCoordinate2D = CLLocationCoordinate2DMake(placemark.location.coordinate.latitude, placemark.location.coordinate.longitude)
annotation.coordinate = location
annotation.title = "\(StudentArray[student].firstName), \(StudentArray[student].lastName)"
annotation.subtitle = "\(StudentArray[student].grade)"
self.mapView.addAnnotation(annotation)
}
})