0

For a method like

(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section

if I want to implement it for certain tableViews in my view, and not others, is there a way to return the default implementation? TIA

J W
  • 868
  • 1
  • 12
  • 25

1 Answers1

0

Yes. Just return super's implementation.

if (tableView == myTableView) {
  // create and return your custom header
}
else {
  return [super tableView:tableView viewForHeaderInSection:section];
}
sosborn
  • 14,676
  • 2
  • 42
  • 46
  • It doesn't work because UITableViewDataSource is a protocol and has no super (default) method. I think just returning nil is okay. – hoshi Nov 30 '11 at 01:20