回答編集履歴

1

質問3。

2016/09/23 09:06

投稿

fuzzball
fuzzball

スコア16731

test CHANGED
@@ -29,3 +29,47 @@
29
29
  let label2 = cell.contentView.viewWithTag(2) as! UILabel
30
30
 
31
31
  ```
32
+
33
+
34
+
35
+ # 質問3
36
+
37
+
38
+
39
+ ReciveData2の中身が無い、もしくは、足りないようです。
40
+
41
+
42
+
43
+ SecondViewControllerのviewDidLoadの最後に下記のコードを追加して、出力されたログを教えて下さい。(それぞれ最初の5行程度でいいです)
44
+
45
+
46
+
47
+ ```swift
48
+
49
+ print("ReciveData(\(ReciveData))=", ReciveData)
50
+
51
+ print("ReciveData2(\(ReciveData2))=", ReciveData2)
52
+
53
+ ```
54
+
55
+
56
+
57
+ あと、label2の設定をしている箇所を下記のコードに差し替えると、とりあえず落ちなくなると思います。
58
+
59
+
60
+
61
+ ```swift
62
+
63
+ if indexPath.row < ReciveData2.count {
64
+
65
+ label2.text = ReciveData2[indexPath.row]
66
+
67
+ } else {
68
+
69
+ label2.text = "error(\(indexPath.row)/\(ReciveData2.count))"
70
+
71
+ }
72
+
73
+ ```
74
+
75
+