【发布时间】:2015-08-19 17:14:13
【问题描述】:
我正在关注 Google API 文档并尝试在当前设备周围查找位置。我正在尝试使用 GMSPlacesClient.currentPlaceWithCallback。
文档示例是
GMSPlacesClient.currentPlaceWithCallback({ (placeLikelihoods: GMSPlaceLikelihoodList,error) -> Void in
if error != nil {
println("Current Place error: \(error.localizedDescription)")
return
}
for likelihood in placeLikelihoods.likelihoods {
if let likelihood = likelihood as? GMSPlaceLikelihood {
let place = likelihood.place
println("Current Place name \(place.name) at likelihood \(likelihood.likelihood)")
println("Current Place address \(place.formattedAddress)")
println("Current Place attributions \(place.attributions)")
println("Current PlaceID \(place.placeID)")
}
}
})
但是,构建失败并出现错误无法使用类型为“((GMSPlaceLikelihoodList,_)-> Void)”的参数列表调用“currentPlaceWithCallback”
请提出建议..谢谢
【问题讨论】:
标签: ios xcode swift google-maps-sdk-ios