質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

Q&A

解決済

2回答

1906閲覧

Thread 1: signal SIGABRTのエラー

tatsu757

総合スコア12

iOS

iOSとは、Apple製のスマートフォンであるiPhoneやタブレット端末のiPadに搭載しているオペレーションシステム(OS)です。その他にもiPod touch・Apple TVにも搭載されています。

Xcode

Xcodeはソフトウェア開発のための、Appleの統合開発環境です。Mac OSXに付随するかたちで配布されています。

Swift

Swiftは、アップルのiOSおよびOS Xのためのプログラミング言語で、Objective-CやObjective-C++と共存することが意図されています

0グッド

0クリップ

投稿2019/09/06 06:35

編集2019/09/06 06:43

前提・実現したいこと

Thread 1: signal SIGABRTのエラーを解消したい

発生している問題・エラーメッセージ

練習用のTODOアプリでシミュレーターを起動したところThread 1: signal SIGABRTのエラーが出て立ち上がらない

Thread 1: signal SIGABRT 2019-09-06 15:40:00.211028+0900 Swift5ToDoTatsuto[4202:229948] libMobileGestalt MobileGestalt.c:890: MGIsDeviceOneOfType is not supported on this platform. 2019-09-06 15:40:00.364068+0900 Swift5ToDoTatsuto[4202:229948] *** Assertion failure in -[UITableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore_Sim/UIKit-3698.140/UITableView.m:8054 2019-09-06 15:40:00.368430+0900 Swift5ToDoTatsuto[4202:229948] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier ToDoItemCell - must register a nib or a class for the identifier or connect a prototype cell in a storyboard' *** First throw call stack: ( 0 CoreFoundation 0x00000001062bc8db __exceptionPreprocess + 331 1 libobjc.A.dylib 0x00000001048d3ac5 objc_exception_throw + 48 2 CoreFoundation 0x00000001062bc662 +[NSException raise:format:arguments:] + 98 3 Foundation 0x000000010432176b -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 194 4 UIKitCore 0x0000000108d7c4d2 -[UITableView _dequeueReusableCellWithIdentifier:forIndexPath:usingPresentationValues:] + 851 5 UIKitCore 0x0000000108d7c14b -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 91 6 Swift5ToDoTatsuto 0x0000000103fee3df $s17Swift5ToDoTatsuto22TodoListViewControllerC05tableG0_12cellForRowAtSo07UITableG4CellCSo0nG0C_10Foundation9IndexPathVtF + 303 7 Swift5ToDoTatsuto 0x0000000103fee70b $s17Swift5ToDoTatsuto22TodoListViewControllerC05tableG0_12cellForRowAtSo07UITableG4CellCSo0nG0C_10Foundation9IndexPathVtFTo + 155 8 UIKitCore 0x0000000108d96f60 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 764 9 UIKitCore 0x0000000108d97499 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 73 10 UIKitCore 0x0000000108d5f654 -[UITableView _updateVisibleCellsNow:isRecursive:] + 2870 11 UIKitCore 0x0000000108d7f76b -[UITableView layoutSubviews] + 165 12 UIKitCore 0x0000000109039e69 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1417 13 QuartzCore 0x000000010a5bcd22 -[CALayer layoutSublayers] + 173 14 QuartzCore 0x000000010a5c19fc _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 396 15 QuartzCore 0x000000010a5cdd58 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 72 16 QuartzCore 0x000000010a53d24a _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 328 17 QuartzCore 0x000000010a574606 _ZN2CA11Transaction6commitEv + 610 18 UIKitCore 0x0000000108b742c3 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 128 19 CoreFoundation 0x0000000106223cbc __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12 20 CoreFoundation 0x0000000106223480 __CFRunLoopDoBlocks + 336 21 CoreFoundation 0x000000010621dd04 __CFRunLoopRun + 1252 22 CoreFoundation 0x000000010621d4d2 CFRunLoopRunSpecific + 626 23 GraphicsServices 0x000000010e3882fe GSEventRunModal + 65 24 UIKitCore 0x0000000108b5afc2 UIApplicationMain + 140 25 Swift5ToDoTatsuto 0x0000000103ff065b main + 75 26 libdyld.dylib 0x00000001076c9541 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

該当のソースコード

import UIKit class TodoListViewController: UITableViewController { //アイテムクラス class Item{ var title : String var done : Bool = false //titleを初期化 init(title: String){ self.title = title } } //Itemを格納する配列を作成 var itemArray: [Item] = [] override func viewDidLoad() { super.viewDidLoad() //NavigationBarのタイトルを大きく表示する。 navigationController?.navigationBar.prefersLargeTitles = true let item1: Item = Item(title: "タスク1") let item2: Item = Item(title: "タスク2") let item3: Item = Item(title: "タスク3") //配列に追加 itemArray.append(item1) itemArray.append(item2) itemArray.append(item3) } //MARK-セルの数を指定 override func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return itemArray.count } //MARK-セルのカスタマイズ override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCell(withIdentifier: "ToDoItemCell", for: indexPath) let item = itemArray[indexPath.row] cell.textLabel?.text = item.title cell.accessoryType = item.done ? .checkmark : .none return cell } //MARK-チェックマーク機能 override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) { //選択したセルを let item = itemArray[indexPath.row] //チェック→無印、無印→チェック item.done = !item.done //リロードして反映 self.tableView.reloadData() //セルを選択した時の背景の変化を遅くする tableView.deselectRow(at: indexPath, animated: true) } }

試したこと

当該のエラーメッセージに関して検索するとIBOutletの接続の問題であることが多いとされていますが、現段階では何も接続していません。

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

fuzzball

2019/09/06 06:36

Consoleに表示されているエラーメッセージを書いて下さい。
guest

回答2

0

ベストアンサー

StoryboardのセルにセルIDを付けて下さい。

投稿2019/09/06 06:48

fuzzball

総合スコア16731

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

tatsu757

2019/09/06 06:53

解決しました! ありがとうございました!!
guest

0

コンソールの3行目

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell with identifier ToDoItemCell

なので、よくそこを確認してくださいね。

投稿2019/09/06 06:45

hameji

総合スコア1380

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問