gpt4 book ai didi

ios - Google 的 GMSAutocompleteTableDataSourceDelegate API 部分适用于 iOS

转载 作者:行者123 更新时间:2023-11-30 12:03:26 28 4
gpt4 key购买 nike

我为我的项目实现了 GMSAutocompleteTableDataSourceDelegate。我看到数据正在根据搜索结果加载。但是,当我单击结果时,不会调用其相应的委托(delegate)方法。

正在调用以下委托(delegate)方法

    func didRequestAutocompletePredictions(for tableDataSource: GMSAutocompleteTableDataSource) {        UIApplication.shared.isNetworkActivityIndicatorVisible = true        resultsController?.tableView.reloadData()    }    func didUpdateAutocompletePredictions(for tableDataSource: GMSAutocompleteTableDataSource) {        UIApplication.shared.isNetworkActivityIndicatorVisible = false        resultsController?.tableView.reloadData()    }       

从建议中选择地址后,理想情况下应该调用以下方法之一。但是,没有任何方法被调用。

    func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didAutocompleteWith place: GMSPlace) {    }    func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didFailAutocompleteWithError error: Error) {    }    func tableDataSource(_ tableDataSource: GMSAutocompleteTableDataSource, didSelect prediction: GMSAutocompletePrediction) -> Bool {        return true    }

如果有人能给我一些如何解决这个问题的想法或一些调试技巧,那就太好了

最佳答案

我发现了问题。原因是 View 有一个 UIGesture 委托(delegate)。由于这个委托(delegate)方法,它取消了所有事件。

关于ios - Google 的 GMSAutocompleteTableDataSourceDelegate API 部分适用于 iOS,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46934658/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com