nib but didn't get a UITableView

后端 未结 13 1662
误落风尘
误落风尘 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:47

    I had a similar problem using storyboards. I'll post my solution for the benefit of others. The key is that if you have correctly set the file's owner to the subclass of UITableView you still have to make sure the view property is set to the Table View. I'm using storyboards, but the same sort of thing should apply to nibs as well. Expand the "document outline" so you can see the hierarchy of your storyboard. I will include some screen shots below. The quick way to solve this is that you want to look at your view in the document outline. Delete any tableview you have as a child of it. Drag the other tableview on top of the view property. Done. I'll show you in screen shots.

    enter image description here

    Notice the two tables. You want to remove table1 and its cell.

    enter image description here

    Good. Now drag table2 to the view and you're done. Should work now. Basically if you have a subclass of UITableViewController then it must have Table View in place of view or it will crash.

    enter image description here

提交回复
热议问题