Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No content attribute for UITableView in .xib

(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?

like image 687
Patrick Pijnappel Avatar asked Jan 21 '12 13:01

Patrick Pijnappel


1 Answers

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

like image 56
guoc Avatar answered Oct 18 '22 20:10

guoc