swift - Error: Could not cast value of type NSKVONotifying_MKUserLocation to Park_View.AttractionAnnotation -
when using func:
func mapview(mapview: mkmapview!, viewforannotation annotation: mkannotation!) -> mkannotationview! { let annotationview = attractionannotationview(annotation: annotation, reuseidentifier: "attraction") annotationview.canshowcallout = true return annotationview }
this error occured:
could not cast value of type 'nskvonotifying_mkuserlocation' (0x7e8a62b0) 'park_view.attractionannotation' (0xf7948).
it working when try add corelocation find user location code start having error.
i found out mkuserlocation annotation too.
here solution came out , solve error.
func mapview(mapview: mkmapview!, viewforannotation annotation: mkannotation!) -> mkannotationview! { if (annotation mkuserlocation) { return nil } else { let annotationview = attractionannotationview(annotation: annotation, reuseidentifier: "attraction") annotationview.canshowcallout = true return annotationview } }
Comments
Post a Comment