1
我正在開發一個應用程序的ios 9.自從我更新到7.1版本我有這個錯誤: 命令由於信號失敗:分段錯誤: 11命令由於信號失敗:分段錯誤:更新到Xcode 7.1後的11:
展望的代碼,我發現這個代碼導致此錯誤:
func mapView(mapView: MKMapView, viewForAnnotation annotation: MKAnnotation) -> MKAnnotationView? {
if !(annotation is ADBaseAnnotation){
print("No es ADBaseAnnotation",terminator:"\n")
return nil
}
var anView = mapView.dequeueReusableAnnotationViewWithIdentifier((annotation as! ADBaseAnnotation).getReuseId())
if let normal = annotation as? NormalParking {
//anView = normal.getAnnotationView(annotation, reuseIdentifier: normal.getReuseId())
} else if let hightlight = annotation as? HightLightParking{
//anView = hightlight.getAnnotationView(annotation, reuseIdentifier: hightlight.getReuseId())
}
return anView
}
錯誤是由註釋行引起。請幫忙
您好,有效ADBaseAnnotation是共享類。編譯器由於未知錯誤而下降,不是語法錯誤。在更新Xcode之前,正在使用此代碼。 我測試了你的代碼,工作正常。 Gracias! – ClarkXP
您的代碼可能是正確的,但對編譯器來說太混亂了。斯威夫特剛剛一歲!我對元組上的映射過濾器有一個類似的問題,它是無法解決的一些奇怪的方法鏈。 –