nib but didn't get a UITableView

后端 未结 13 1698
误落风尘
误落风尘 2020-11-30 05:26

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

Terminating app due to uncaught exception \'NSInternalInconsist

13条回答
  •  孤街浪徒
    2020-11-30 05:52

    @smileBot answer helped me realized the solution is very easy and the error raised by iOS makes sense

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

    Their basically saying that nib's view controller is not returning a UITableView because it isn't, for most - your nib is returning a View - which is created for you by default when you create a new ViewController in the Xcode IDE.

    The solution is as simple as deleting that View - which might feel against the norm - but go ahead and select it and backspace - then drag and drop a UITableView inside your ViewController and this UITableView will now act as your root view inside your TableViewController.

    Keep in mind this is only necessary for classes directly subclassing UITableViewController.

    Good luck.

提交回复
热议问题