質問編集履歴
1
コード記述の場所を修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -8,7 +8,8 @@
|
|
8
8
|
fatal error: unexpectedly found nil while unwrapping an Optional value
|
9
9
|
|
10
10
|
###該当のソースコード
|
11
|
+
|
11
|
-
swift3
|
12
|
+
```swift3
|
12
13
|
import UIKit
|
13
14
|
|
14
15
|
//セルに表示するデータ
|
@@ -53,7 +54,6 @@
|
|
53
54
|
//セルがタップされた時の処理
|
54
55
|
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){
|
55
56
|
tableView.deselectRow(at: indexPath, animated: false)
|
56
|
-
// セルがタップされた時の処理
|
57
57
|
print("タップされたセルのindex番号: (indexPath.row)")
|
58
58
|
result = indexPath.row
|
59
59
|
if result == 0 {
|
@@ -129,10 +129,13 @@
|
|
129
129
|
}
|
130
130
|
}
|
131
131
|
|
132
|
+
```
|
132
133
|
|
133
134
|
|
135
|
+
|
134
136
|
###該当のソースコード
|
137
|
+
|
135
|
-
swift3
|
138
|
+
```swift3
|
136
139
|
import UIKit
|
137
140
|
|
138
141
|
class ViewController: UIViewController {
|
@@ -161,7 +164,9 @@
|
|
161
164
|
// Dispose of any resources that can be recreated.
|
162
165
|
}
|
163
166
|
}
|
167
|
+
```
|
164
168
|
|
169
|
+
|
165
170
|
###試したこと
|
166
171
|
上記のコードでViewControllerの方のindexLabel.text = String(received!)で[EXC_BAD_INSTRUCTION]とエラーがでてデバックエリアには[fatal error: unexpectedly found nil while unwrapping an Optional value]とでます。
|
167
172
|
myLabel.text = data のところは何も表示されません。
|