LoginSignup
0
0

More than 5 years have passed since last update.

'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:' エラーの対処

Posted at

(主観的には)何もしていないのに急に下記エラーが出てきて開発が少し止まった。
解決策を備忘録的に記す。

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'

このエラーは、TableView が正常なtableView:cellForRowAtIndexPath メソッドを見つけられていないことに起因する。

  • 問題となっているクラスの中のtableView:cellForRowAtIndexPath メソッドの名前が意図せず書き換わっている
  • TableViewとDatasource のつなぎ込みが解除されている。

などの問題があると考えられる。

特に、「何もしていないのに急にこのエラーが出て動かなくなった」なんて時はミスタイプなどで名前が書き換わっている可能性が非常に高い。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0