Google Place Autocomplete不会显示任何搜索结果

时间:2017-09-26 06:31:44

标签: ios google-maps swift3 google-places-api

我正在使用Google地方自动填充功能。但是,当我尝试在搜索栏中键入任何单个位置时,结果为空,当我单击搜索栏时,它会向我提示以下消息。 (在此之前工作正常,能够搜索结果)

 2017-09-26 14:23:09.650 myApp Consumer[43113:735286] Google Maps SDK for iOS and Google Places API for iOS version: 2.4.30121.0
    2017-09-26 14:23:11.975813+0800 myApp Consumer[43113:735286] [MC] Error getting system group container for systemgroup.com.apple.configurationprofiles: 21
    2017-09-26 14:23:11.976028+0800 myApp Consumer[43113:735286] [MC] Failed to get profiles system group container
    2017-09-26 14:23:11.979185+0800 myApp Consumer[43113:735286] [MC] Reading from private effective user settings.

以下是一些代码,

override func viewDidLoad() {
    super.viewDidLoad()

    self.googleMapsView = GMSMapView(frame: self.mapView.frame)
    self.view.addSubview(self.googleMapsView)

    searchResultController = SearchResultsController()
    searchResultController.delegate = self
    gmsFetcher = GMSAutocompleteFetcher()
    gmsFetcher.delegate = self

    searchBar()
}


func searchBar() {
        self.searchController = UISearchController(searchResultsController: searchResultController)

        self.searchController.delegate = self
        self.searchController.searchBar.delegate = self

        self.searchController.hidesNavigationBarDuringPresentation = false
        self.searchController.dimsBackgroundDuringPresentation = true

        self.navigationItem.titleView = searchController.searchBar
        self.definesPresentationContext = true
    }

0 个答案:

没有答案