質問編集履歴
2
書式の改善
title
CHANGED
File without changes
|
body
CHANGED
@@ -2,7 +2,6 @@
|
|
2
2
|
Thread 1: Exception: "unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard"
|
3
3
|
|
4
4
|
なぜこのようなエラーがでてしまうのでしょうか?```swift
|
5
|
-
コード
|
6
5
|
```import UIKit
|
7
6
|
|
8
7
|
class ViewController: UIViewController, UITableViewDataSource, UITableViewDelegate {
|
@@ -46,4 +45,5 @@
|
|
46
45
|
present(alertController, animated: true, completion: nil)
|
47
46
|
}
|
48
47
|
|
49
|
-
}
|
48
|
+
}
|
49
|
+
```
|
1
文字の変更
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
ToDoアプリを作っていて追加ボタンを押すとアラートが出てテキストを入力す
|
1
|
+
ToDoアプリを作っていて追加ボタンを押すとアラートが出てテキストを入力しOKボタンを押すとセルに表示させたいのですが、テキストを打ち込み追加を押すとこのようなエラーが出てしまいます。
|
2
2
|
Thread 1: Exception: "unable to dequeue a cell with identifier Cell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard"
|
3
3
|
|
4
4
|
なぜこのようなエラーがでてしまうのでしょうか?```swift
|
@@ -31,7 +31,7 @@
|
|
31
31
|
|
32
32
|
@IBAction func addAction(_ sender: UIBarButtonItem) {
|
33
33
|
let alertController = UIAlertController(title: title, message: "", preferredStyle: .alert)
|
34
|
-
let okAlert = UIAlertAction(title: "
|
34
|
+
let okAlert = UIAlertAction(title: "OK", style: .default) { (action) in
|
35
35
|
let textFiels = alertController.textFields![0]
|
36
36
|
let tasktitle = textFiels.text
|
37
37
|
self.tasks.append(tasktitle!)
|