错误:'-[UITableViewController loadView] instantiated view controller with identifier "CDHomeTableVC" from storyboard "Main", but didn't get a UITableView.'

错误'-[UITableViewController loadView] instantiated view controller with identifier "CDHomeTableVC" from storyboard "Main", but didn't get a UITableView.'

最近在写swift时候老是遇到这个错误后面找了些资料总结下记录下错误原因:

  在写代码时候我在Storyboard 第一次拖得是个ViewController 普通视图,但是后面项目需求改变了视图,需要的是tableViewController,更换后运行就会报下面错误:instantiated view controller with identifier "CDHomeTableVC" from storyboard "Main", but didn't get a UITableView.' 后面查看资料才知道在tableViewController 没有view  而ViewController普通视图中有view 我把view 删除后运行就没有问题,应该是我tableView 直接覆盖在view 导致的问题,删除后就没有任何问题以后得注意Storyboard配套使用。

posted @ 2017-09-15 15:42  人生在与不断学习。  阅读(904)  评论(0编辑  收藏  举报