0

I was trying to display something in static cells with a Table View.

First I create a Table View Controller in interface builder with static cells.

I never designate a custom UITableViewController class, it works well.

But since I designate it to MyTableViewController class, the table view displays nothing.

How to make static cells appear when using a custom UITableViewController class?

Franz Wang
  • 596
  • 4
  • 14
  • 1
    Please refer http://stackoverflow.com/questions/8639780/uitableview-with-static-cells-does-not-appear – pinxue Dec 08 '13 at 14:02

1 Answers1

0

In the method:

cellForRowAtIndexPath

you have to get a cell with identifier and then manage it and return it:

static NSString *identifier = @"YourCellIdentifier";

CustomCell *cell = [tableView dequeueReusableCellWithReuseIdentifier:identifier forIndexPath:indexPath];

return cell;

you must set identifier in interface builder..you have to select the cell and write the identifier in the inspector field.

Matteo Gobbi
  • 17,697
  • 3
  • 27
  • 41
  • Thank you very much for your answering. I figure it out by just commenting the table view delegate methods (`UITableViewDelegate` and `UITableViewDataSource` methods) in my custom `UITableViewController` class. I think it may hijacks the table view I built in IB, so once I comment it, it works. It might be done by super class or somewhere. – Franz Wang Dec 08 '13 at 16:44