我正在使用Google PlaceAutoComplete方法获取在textField中输入的Addess的建议.
func placeAutocomplete(text:String) {
let placesClient = GMSPlacesClient()
let filter = GMSAutocompleteFilter()
filter.type = .Address
placesClient.autocompleteQuery("New Delhi", bounds: nil, filter: nil) { (results, error) in
guard error == nil else {
print("Autocomplete error \(error)")
return
}
self.addressArray.removeAll()
for result in results! {
self.addressArray.append(result.attributedFullText.string)
print("Result \(result.attributedFullText.string) with placeID \(result.placeID)")
}
}
}
Run Code Online (Sandbox Code Playgroud)
当我称这种方法.它崩溃了,说下面的错误.
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary boolValue]: unrecognized selector sent to instance 0x7fe338f01e40'
Run Code Online (Sandbox Code Playgroud)
我试图找到使用异常断点但不起作用.可以有任何想法,我错了吗?