Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ios : Assertion failure UITableView dataSource is not set

Why I am getting an error like this? In my appicaction I am loading webview inside a table view.

*** Assertion failure in -[UITableView _createPreparedCellForGlobalRow:withIndexPath:], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableView.m:6048
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView dataSource is not set'
like image 261
Dev Avatar asked Sep 03 '25 09:09

Dev


1 Answers

In my case, it was a DatePicker throwing the error when I set it's .date property in viewDidLoad. When I moved the code to viewDidAppear, the issue gone.

This error happen only in iPhone 4s, not other later models, iPhone nor iPad.

like image 72
user7808376 Avatar answered Sep 04 '25 23:09

user7808376