You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.29 12:45:08