안녕하세요 여러분의 주석의 핀을 맞춤 이미지로 바꾸려고합니다.pin 대신 annotation에 이미지를 할당
이미지에 이미 이미지가 있습니다. 카세트 목록에 1X 2X 3X 등이 표시되지만 이미지를 호출하자마자 Xcode
은 내 구문을 수정하려고 시도하지만 결국에는 오류가 발생합니다. 초과 오류로
내 코드
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