title: Using a XIB file for custom Tableview Section Header
body: <p>I wanted to use a xib file to customise a tableview section in xcode (objective C), and here ar my files:</p>
  
  <p>SectionHeaderView.xib is a UIView with a UILabel</p>
  
  <p>SectionHeaderView.m</p>
  
  <pre><code>#import "SectionHeaderView.h"
  
  @implementation SectionHeaderView
  
  @synthesize sectionHeader;
  
  @end
  </code></pre>
  
  <p>SectionHeaderView.h</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  
  @interface SectionHeaderView : UIView
  {
  IBOutlet UILabel *sectionHeader;
  }
  
  @property (nonatomic, strong) IBOutlet UILabel *sectionHeader;
  
  @end
  </code></pre>
  
  <p>and in my MasterViewController.m </p>
  
  <pre><code>#import "SectionHeaderView.h"
  
  - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  
  SectionHeaderView  *header = [[[NSBundle mainBundle] loadNibNamed:@"SectionHeaderView" owner:self options:nil] objectAtIndex:0];
  
  return header;
  
  }
  </code></pre>
  
  <p>It works ok till here, however as soon as I set XIB file owner's custom class to "SectionHeaderView" and connect the Label to  "sectionHeader" I will get the error "NSUnknownKeyException". I wanted to connect these so I could change the label.text by the following code before returning the haeder:</p>
  
  <pre><code>header.sectionHeader.text = headerText;
  </code></pre>
  
  <p>I am using storyboard (xcode 4.5) for the MasterViewController.
  Would appreciate any help</p>