开发者

Navigation Controller with Table View

开发者 https://www.devze.com 2023-02-23 14:06 出处:网络
I am trying to create a multi-view app with navigation template. I want table on the bottom part of initial view, with other views (image view, labels, etc) on the top. As previously recommended, I mo

I am trying to create a multi-view app with navigation template. I want table on the bottom part of initial view, with other views (image view, labels, etc) on the top. As previously recommended, I modified RootViewController.xib to add UIView, then moved table view to that view. Also, as recommended, I set view connection of File's Owner to new view, rather than tableview. However, when I launch the app, it crashes with message :

 'NSInternalInconsistencyException', reason: '-[开发者_JAVA技巧UITableViewController loadView] loaded        the "RootViewController" nib but didn't get a UITableView.'

Can someone please help and point me in the right direction? I would be muchly appreciative!


Ok I'm not an expert but I encountered this problem a few times. What I did to solve it was to add a TableView Controller from the right bar, this gives you a Table View Controller already together with a Table View, so the only thing you have to do is set your custom class in it. Once again I'm no expert but this made the message go away, hope it helps.

UPDATE: just wanted to reiterate what SVD pointed out, you need to have a new outlet instead of the one that comes with it, the 'view' one, otherwise the data for the table won't show.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号