No content attribute for UITableView in .xib

孤者浪人 提交于 2019-12-21 10:48:05

问题


(XCode 4.2, iOS 5)

In order to reuse a tableview (with a navigation bar and edit/add buttons) I created a UITableViewController subclass with it's own .xib. However, when I add a UITableView to my .xib's main view the content attribute (which I want to set to dynamic prototypes) it doesn't show up. It just shows the sample content (California: Brea, Burlingame, ...). When I add a UITableView in my main storyboard the content attribute does show up.

What is the issue?


回答1:


For people trying to solve this, it is impossible to set dynamic prototypes cells in a .xib, or even static cells. No embedded sections or cells are supported in .xib files. If you drag a Table View Controller into a .xib, you'll get an error:

Table views with embedded sections and cells are only supported in storyboard documents

Xcode 6.3.2



来源:https://stackoverflow.com/questions/8953490/no-content-attribute-for-uitableview-in-xib

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!