[self tableView:self.tableView titleForHeaderInSection:section]
を使用してタイトルを取得しようとしましたが、すぐにこの質問を投稿した後、super
から呼び出されたはずです。したがって:
[super tableView:self.tableView titleForHeaderInSection:section]
です。
ヘッダを使用してカスタマイズすることができる
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
NSString *title = [super tableView:self.tableView titleForHeaderInSection:section];
if (title.length == 0) return nil;
UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 40)];
label.textColor = [UIColor whiteColor];
label.backgroundColor = [UIColor clearColor];
label.text = title;
return label;
}