小编Suc*_*ija的帖子

Google自动填充功能在通话后崩溃

我正在使用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)

我试图找到使用异常断点但不起作用.可以有任何想法,我错了吗?

google-maps ios google-places-api swift

10
推荐指数
1
解决办法
588
查看次数

标签 统计

google-maps ×1

google-places-api ×1

ios ×1

swift ×1