小编shi*_*dya的帖子

GMSAutocompletePrediction forecast.attributedFullText不在swift 3.0中给出nsmutablestring

我在swift项目中使用GMSAutocompleteFetcher来搜索地点.在这里,我使用pod安装'GooglePlaces''GooglePlacePicker''GoogleMaps',并在链接https://developers.google.com/places/ios-api/autocomplete#use_the_fetcher中编写所有内容, 但在textFieldDidChange中写入后,我得到的结果是它在委托方法中:

func didAutocomplete(with predictions: [GMSAutocompletePrediction]) {
        let resultsStr = NSMutableString()
        for prediction in predictions {
            resultsStr.appendFormat("%@\n", prediction.attributedFullText)

        }
Run Code Online (Sandbox Code Playgroud)

但在resultsStr得到的价值:

 Ca{
    GMSAutocompleteMatch = "<GMSAutocompleteMatchFragment: 0x608000223940>";
}lifornia{
}
Run Code Online (Sandbox Code Playgroud)

应该是"加利福尼亚"

ios google-places-api swift3 gmsautocomplete

2
推荐指数
1
解决办法
964
查看次数

标签 统计

gmsautocomplete ×1

google-places-api ×1

ios ×1

swift3 ×1