UITableView with static cells does not appear

adum picture adum · Dec 27, 2011 · Viewed 57.3k times · Source

I have created a new Xcode project using Storyboards (tab view template). I added a couple of view controllers to my storyboard, and wanted to use a UITableView with static cells for one. I created it, but when I run in the simulator the cells don't appear. I haven't changed anything in the project except for this storyboard file. I am showing screenshots of the storyboard editor and the simulator running. The label shows up, so the view is loading correctly. I set the background color to gray so I can see the talbeview is loading. All cells are set to visible. I changed their style to Basic and edited the label, and added a disclosure indicator, that's all.

simulator xcode

Answer

Joe Y picture Joe Y · Mar 31, 2012

Don't implement any of the methods below when you use the static table view:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
}