ios mapkit,运营商名称与[LogMessageLogging]崩溃6.1无法检索运营商名称
问题描述:
我在我的应用中添加了MapKit。我已经通过IBOUTLET将MKmapview连接到了我的视图控制器,它在模拟器中运行良好,但是它在此设备上崩溃,此ios mapkit,运营商名称与[LogMessageLogging]崩溃6.1无法检索运营商名称
[LogMessageLogging] 6.1无法检索CarrierName。 CTError:domain-2,code-5,errStr :((os/kern)失败)。
我正在从CLLocationmanager中取用户的位置,并尝试在地图中添加注释。代码如下:
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
let userLocation:CLLocation = locations[0] as CLLocation
let coordinate = CLLocationCoordinate2D(latitude: userLocation.coordinate.latitude, longitude: userLocation.coordinate.longitude)
MD_myCurrentLocation = coordinate
setupLocationMarker(coordinate:coordinate)
manager.stopUpdatingLocation()
}
FUNC setupLocationMarker(坐标:CLLocationCoordinate2D){
iosMap.removeAnnotations(iosMap.annotations)
let span = MKCoordinateSpanMake(0.01, 0.01)
let region = MKCoordinateRegion(center: coordinate, span: span)
iosMap.setRegion(region, animated: true)
let annotation = MKPointAnnotation()
annotation.coordinate = coordinate
iosMap.addAnnotation(annotation)
}
答
尝试通过将>>设置>>通用>>复位重置设备的网络配置>>重置网络设置。在AppDelegate中
希望
或者
进口CoreTelephony这会有所帮助。
已经完成,它不起作用。 – Prabin