teratail header banner
teratail header banner
質問するログイン新規登録

質問編集履歴

2

書式の改善

2020/06/19 16:30

投稿

taiseiswift
taiseiswift

スコア20

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
+ ```![イメージ説明](6adc797f5530a2c629f0dcdd3c39ccc3.png)

1

文字の変更

2020/06/19 16:30

投稿

taiseiswift
taiseiswift

スコア20

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: "追加", style: .default) { (action) in
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!)