質問編集履歴

3

本文追記

2017/11/16 06:16

投稿

po_tato
po_tato

スコア97

test CHANGED
File without changes
test CHANGED
@@ -68,7 +68,7 @@
68
68
 
69
69
  let jsons = JSON(object)
70
70
 
71
- print("jsonsだよ",jsons)
71
+ print("jsonsだよ",jsons)//←他デバッグ機ならjson取得できるのにios11.0.3の方はなぜかエラー
72
72
 
73
73
  self.header = [UIImage()]
74
74
 

2

本文追記

2017/11/16 06:16

投稿

po_tato
po_tato

スコア97

test CHANGED
File without changes
test CHANGED
@@ -49,3 +49,37 @@
49
49
  end
50
50
 
51
51
  ```
52
+
53
+
54
+
55
+ 落ちている箇所の一部ソース
56
+
57
+ ```
58
+
59
+ Alamofire.request("http://~api.php",method: .post, parameters: param).responseJSON { response in
60
+
61
+ print("JSON: (response.result)") // result of response serialization
62
+
63
+ guard let object = response.result.value else{
64
+
65
+ return
66
+
67
+ }
68
+
69
+ let jsons = JSON(object)
70
+
71
+ print("jsonsだよ",jsons)
72
+
73
+ self.header = [UIImage()]
74
+
75
+ var header_img:[String] = []
76
+
77
+ header_img.append(jsons["url"].string!)//←これに(Thread 1: Fatal error: Unexpectedly found nil while unwrapping an Optional value)
78
+
79
+ //省略
80
+
81
+
82
+
83
+ }//header
84
+
85
+ ```

1

修正

2017/11/16 06:14

投稿

po_tato
po_tato

スコア97

test CHANGED
File without changes
test CHANGED
@@ -25,3 +25,27 @@
25
25
  上記に記した私の環境でAlamofireやswiftyJSONの最適なバージョンを
26
26
 
27
27
  ご存知の方はいらっしゃらないでしょうか?
28
+
29
+
30
+
31
+ 導入はcocoapodsを使用しており
32
+
33
+ 内容は以下でございます。
34
+
35
+ ```
36
+
37
+ platform :ios, '9.0'
38
+
39
+ target 'appName' do
40
+
41
+ use_frameworks!
42
+
43
+ pod 'SwiftyJSON'
44
+
45
+ pod 'Alamofire'
46
+
47
+ pod 'AlamofireImage'
48
+
49
+ end
50
+
51
+ ```