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

Suc*_*ija 10 google-maps ios google-places-api swift

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

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

Suc*_*ija 1

我通过在应用程序传输安全设置中更正 plist 中的“允许任意加载”解决了该问题。我输入的是 true,但其类型设置为字符串而不是布尔值