我收到错误:EXC_BAD_INSTRUCTION用于此函数的最后两行。在我的代码中,我得到了用户位置,并希望将其用于引脚的位置。提前谢谢!
@IBAction func makeEvent(sender: UIButton)
{
self.pointAnnotation1 = MKPointAnnotation()
self.pointAnnotation1.title = "Event"
self.pointAnnotation1.coordinate = CLLocationCoordinate2D(latitude: 38.986, longitude: -78.945)
self.pinAnnotationView = MKPinAnnotationView(annotation: self.pointAnnotation, reuseIdentifier: nil)
self.mapView.centerCoordinate = self.pointAnnotation.coordinate
self.mapView.addAnnotation(self.pinAnnotationView.annotation!)
}