title: How to build UITableView sectionHeader views in Interface Builder for iPhone?
body: <p>I have a UITableView in grouped style in my iPhone app.
  Now I want to customize the section headers with an Image, a label and an activity indicator.</p>
  
  <p>To do this I created a new UIViewController subclass and a XIB file. I added the UIImageView, UILabel and UIActivityIndicatorView as IBOutlet properties to the ViewController and wired them to controls I put into the XIB in Interface Builder.</p>
  
  <p>In the class where my UITableView is made I setup the section headers (two, both instances of the ViewController defined above) and set their properties (image and text). Then I return the ViewControllers view in the tableView delegate:</p>
  
  <pre><code>- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
      if (section == 0) {
          return [favoritesSectionHead view];
      } else {
          return [serverlistSectionHead view];
      }
  }
  </code></pre>
  
  <p>This displays the view as I defined it in Interface Builder, without the custom image and text.
  I know why this happens (the view of a ViewController is created when first needed, in my code this is when I return it in the viewForHeaderInSection method --> when I try to setup the custom values the view is still nil) but I don't know how to fix this.</p>
  
  <p>Can you help me? What do I have to do to init the view before my returns? The UITableView docs tell me not to call "loadView" manually ...</p>
  
  <p>Thanks in advance,
  Mark.</p>