运行我的Swift代码时出现以下错误消息;
2019-11-11 15:59:58.737125 + 0000 GoSiteUK [53192:1746609]-[__ SwiftValue MKCoordinateValue]:无法识别的选择器已发送到实例0x60000037c720
2019-11-11 15:59:58.741797 + 0000 GoSiteUK [53192:1746609] ***由于未捕获的异常'NSInvalidArgumentException'而终止应用程序,原因:'-[__ SwiftValue MKCoordinateValue]:无法识别的选择器已发送至实例0x60000037c720'
此代码以前在几周前运行良好,但现在没有任何变化。
let destinationPlacemark = MKPlacemark(coordinate: CLLocationCoordinate2D(latitude: 50.0, longitude: 1.0))
let destinationMapItem = MKMapItem(placemark: destinationPlacemark)
destinationMapItem.openInMaps(launchOptions: [
MKLaunchOptionsDirectionsModeKey : MKLaunchOptionsDirectionsModeDriving,
MKLaunchOptionsMapCenterKey : CLLocationCoordinate2D(latitude: 51.0, longitude: 0.5)
] )
我希望“地图”应用能够打开,并且没有错误消息。