我的项目出现以下错误,我不确定是什么导致它。
2017-04-04 10:28:39.243789-0500 GBus3[797:148184] libMobileGestalt
MobileGestaltSupport.m:153: pid 797 (GBus3) does not have sandbox access for
frZQaeyWLUvLjeuEK43hmg and IS NOT appropriately entitled
2017-04-04 10:28:39.243948-0500 GBus3[797:148184] libMobileGestalt
MobileGestalt.c:550: no access to InverseDeviceID (see
<rdar://problem/11744455>)
fatal error: unexpectedly found nil while unwrapping an Optional value
2017-04-04 10:28:43.106075-0500 GBus3[797:148184] fatal error: unexpectedly
found nil while unwrapping an Optional value
我相信使用segue在视图控制器之间切换时会发生错误。
这是执行segue的代码
func didTapTrackButton () {
performSegue(withIdentifier: "HomeToTrack", sender: self)
}
这是加载第二个视图控制器的代码
override func loadView() {
super.loadView()
// Building a view
let screenFrame = UIScreen.main.bounds
let contentView = UIView(frame: screenFrame)
// Add Map
self.mapView = MKMapView(frame: screenFrame)
self.mapView.delegate = self
contentView.addSubview(self.mapView)
// Set Tracking
self.locationManager.delegate = self
self.locationManager.requestAlwaysAuthorization()
self.mapView.setUserTrackingMode(MKUserTrackingMode.follow, animated: true)
// Set the built view as our view
self.view = contentView
}