こんにちはみんな。割り当て注釈への画像の代わりに、ピンIは、カスタムイメージに私の注釈にピンを交換しようとしています
イメージカセットリストには1X 2X 3Xなどが表示されますが、イメージを呼び出そうとすぐにXcode
が私の構文を修正しようとしますが、最終的にはそれをスローしますそれが尋ねる場所:エラー
私のコードは、オーバーライドFUNC
func mapView(_ mapView: MKMapView, viewFor annotation: MKAnnotation) -> MKAnnotationView? {
guard !(annotation is MKUserLocation) else {
return nil
}
let annotationIdentifier = "AnnotationIdentifier"
var annotationView: MKAnnotationView?
if let dequeuedAnnotationView = mapView.dequeueReusableAnnotationView(withIdentifier: annotationIdentifier) {
annotationView = dequeuedAnnotationView
annotationView?.annotation = annotation
}
else {
annotationView = MKAnnotationView(annotation: annotation, reuseIdentifier: annotationIdentifier)
annotationView?.rightCalloutAccessoryView = UIButton(type: .detailDisclosure)
}
if let annotationView = annotationView {
annotationView.canShowCallout = true
annotationView.image = UIImage(named: "House")
}
return annotationView
}
今Xcode
がコードにここでエラーを拾っているannotationView.image = UIImage(「家」という名前)の下に記載されているとしてアウト「挿入」、最終結果は、「家」
エラーが何を言ってんセンタリングされていない問題がありますか? – GeneCode
未解決の識別子「ハウス」の使用 – sabrefm1