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