我试图根据表视图中单元格的数量打开不同的位置,所以我编写了此函数:
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let latitude: CLLocationDegrees = self.latitudes[indexPath.row]
let longitude: CLLocationDegrees = self.longitude[indexPath.row]
let coordinate = CLLocationCoordinate2DMake(latitudes,longitude)
let mapItem = MKMapItem(placemark: MKPlacemark(coordinate: coordinate, addressDictionary:nil))
mapItem.openInMaps(launchOptions: [MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeDriving])
}
但是,Xcode给我这个错误“无法将类型'[CLLocationDegrees]'(aka'Array')的值转换为预期的参数类型'CLLocationDegrees'(aka'Double')”
有人知道我该怎么办吗?