nib but didn't get a UITableView

2019-01-07 14:34发布

My application works for iOS 5.1 but for iOS 6 simulator I get the following error.

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UITableViewController loadView] loaded the "MainListViewController" nib but didn't get a UITableView.'

I am subclassing UITableViewController and I don't want to change it.

The tableview is created programmatically, there is a dummy MainListViewController.xib to load from Mainwindow.xib Tab Bar Controller.

I also tried to delete MainListViewController.xib, remove it from the MainWindow.xib Tab Bar Controller, created the MainListViewController in AppDelegate and added it to Tab Bar Controller as UITabBarItem to get rid of this nib problem, but I still get the same error.

标签: ios ios6
13条回答
成全新的幸福
2楼-- · 2019-01-07 15:04

The reason might be :

.h file check that it is a subclass of UIViewController. it will solve the problem.

查看更多
登录 后发表回答