iPhone升级至iOS16.3.1后MapKit无法获取正确定位问题
iOS 16.3.1升级后MapKit定位异常问题
- 基于MapKit开发的餐厅自动补全功能,在iPhone 14升级至iOS 16.3.1(真机)前运行正常,MapKit可正确显示真实定位
- 升级后,应用始终显示纽约中部的默认 fallback 定位,且已确认应用定位权限处于开启状态
- 打印定位坐标时显示纽约位置,同时出现错误提示:
Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)",该错误此前仅在未开启定位权限时触发,现在权限已开仍会出现
以下是viewDidLoad代码:
locationManager.delegate = self locationManager.requestWhenInUseAuthorization() locationManager.requestLocation() locationManager.startUpdatingLocation() mapView.showsUserLocation = true let locationSearchTable = storyboard!.instantiateViewController(withIdentifier: "LocationSearchTable") as! LocationSearchTable resultSearchController = UISearchController(searchResultsController: locationSearchTable) resultSearchController?.searchResultsUpdater = locationSearchTable let searchBar = resultSearchController!.searchBar searchBar.sizeToFit() searchBar.placeholder = "Search for restaurants" navigationItem.titleView = resultSearchController?.searchBar resultSearchController?.hidesNavigationBarDuringPresentation = false definesPresentationContext = true locationSearchTable.mapView = mapView locationSearchTable.handleMapSearchDelegate = self
内容的提问来源于stack exchange,提问作者Marco.py
相关产品推荐
相关产品推荐

