質問編集履歴

1

エラーが発生する場所

2017/11/21 01:40

投稿

harima
harima

スコア17

test CHANGED
File without changes
test CHANGED
@@ -21,3 +21,25 @@
21
21
  mapView.settings.myLocationButton = true
22
22
 
23
23
  ```
24
+
25
+
26
+
27
+ エラーが発生するのは、現在地をタップした時だけで、落としたピンをタップしてもエラーが発生しません。どちらもタップしても mapView(_:didSelect:) に飛びます。現在地をタップした時は、mapView(_:didSelect:) に飛ばないようにしたいです。
28
+
29
+ 実際にエラーが発生している箇所は、
30
+
31
+ ```swift
32
+
33
+ let myAnnotation : MyAnnotation = (view as! MyAnnotationView).annotation as! MyAnnotation
34
+
35
+ ```
36
+
37
+ のところで、エラー要因は、
38
+
39
+ ```swift
40
+
41
+ Could not cast value of type 'MKModernUserLocationView' (0x39fb8380) to 'ComeShuin.MyAnnotationView' (0x2829cc).
42
+
43
+ ```
44
+
45
+ です。どうか宜しくお願い致します。