title: Customize header section for UITableViewController
body: <p>I'll need to customize the header section of a <code>UITableViewController</code> where for each sections a different header text is returned (getting data from datasource as well). This is accomplished using the following:</p>
  
  <pre><code>- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
      NSArray *temp = [listOfMBeans allKeys];
      DLog(@"MBean details: %@", temp);
      NSString *title = [temp objectAtIndex:section];
      DLog(@"Header Title: %@", title);
      return title;
  }; 
  </code></pre>
  
  <p>This works well and I can see the expected output. However I need to change also the font size of text and after looking at similar questions I've implemented the following:</p>
  
  <pre><code>- (UIView *) tableview:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
  {
      DLog(@"Custom Header Section Title being set");
      UIView *headerView = [[[UIView alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)] autorelease];  
  
      UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(0, 0, tableView.bounds.size.width, 30)] autorelease];
      label.text = [tableView.dataSource tableView:tableView titleForHeaderInSection:section];
      label.backgroundColor = [UIColor clearColor];
      label.font = [UIFont boldSystemFontOfSize:14];
  
      [headerView addSubview:label];
      return headerView;
  }
  
  - (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
  {
      return 44.0;
  }
  </code></pre>
  
  <p>However it seems that the code is never called. My understanding was that <code>UITableViewController</code> is setting by default itself as delegate but it seems I'm wrong.</p>
  
  <p>The <code>UITableViewController</code> is created in this way (as part of hierarchical data):</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
      ProjectDetails *detailViewController = [[ProjectDetails alloc] initWithStyle:UITableViewStyleGrouped];
      detailViewController.project = [listOfMetrics objectAtIndex:indexPath.row];
  
      // Push the detail view controller.
      [[self navigationController] pushViewController:detailViewController animated:YES];
      [detailViewController release]; 
  }
  </code></pre>
  
  <p>What changes, I should make to make this working? 
  Thanks.</p>