0

I've created classes both to be the dataSource and delegate of a table view. While the cells are appearing properly, I am finding that this method:

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

is not getting called.

What would be a reason for this?

All I could think of was verifying that I did not implement:

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

and I DID implement:

- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section`

Is there any other reason the method would not be called?

shallowThought
  • 19,212
  • 9
  • 65
  • 112
helloB
  • 3,472
  • 10
  • 40
  • 87
  • Possible duplicate of [UITableView : viewForHeaderInSection: not called during reloadData:](http://stackoverflow.com/questions/15078725/uitableview-viewforheaderinsection-not-called-during-reloaddata) – shallowThought Dec 13 '16 at 16:34
  • @shallowThought thanks for pointing that out. I have clarified my question to indicate that I did implement heightForHeaderInSection. – helloB Dec 13 '16 at 16:36
  • have you implementedhttps://developer.apple.com/reference/uikit/uitableviewdatasource/1614860-numberofsections ? – Volker Dec 13 '16 at 17:41
  • 1
    Are other data source methods being called? Do you have at least 1 section in your table view? – rmaddy Dec 13 '16 at 18:28

0 Answers0