Reputation: 5525
I have a regular ViewController
in which I have added a tableView
that occupies a small portion of screen (as seen below). Because my tableView
is static, I have not implemented any of the Tableview datasource methods as recommended in the answer here. However, the content that I have put in in Storyboard is not showing up, and I am at a loss as to what else could be going on.
To illustrate, the below is what I have set up in Storyboard:
But this is is what shows in the simulator:
I have set self.tableview.delegate = self
in viewDidLoad
, as well as declaring my view controller to be a <UITableViewDelegate>
. However, none of this has helped.
Upvotes: 1
Views: 4924
Reputation: 739
Static cells work only with UITableViewControllers. They serve as a data source for the table view and are responsible for providing it with all those rows you nicely set up it the Interface Buider. I usually use a Container View in such situations. It is a view which displays the another view controller's view inside it. In your case this 'another controller' is a UITableViewController or the one, derived from it.
Upvotes: 6