title: Adding UISearchBar programmatically to UITableView
body: <p>I am attempting to add a <code>UISearchBar</code> (with its corresponding search logic) but there is a problem: I am using the <code>UITableViewController</code> subclass's automatically generated <code>UITableView</code> instead of a separate <code>nib</code> file, and manipulating everything programmatically in terms of the table view.</p>
  
  <p>In Interface Builder, there is an option to add a <strong>Search Bar</strong> and <strong>Search Display Controller</strong> to a <code>nib</code>. Is there a way to accomplish this same task programmatically or is it in my favor to abandon the default <code>UITableView</code> and transfer to a custom <code>UITableView</code> nib file so that I can easily add the <code>UISearchbar</code>?</p>
  
  <p>Also, I have tried testing out just adding a Search Bar to my <code>UITableView</code> header (which is where I want it to go) via the following code in my <code>viewDidLoad</code> implementation, but it shows up behind table section header and hence is invisible unless the table is scrolled down to show what would otherwise be white space. What's up with this?</p>
  
  <pre><code>UISearchBar *testbar = [[UISearchBar alloc] init];
  
  [[self tableView] setTableHeaderView:testbar];
  </code></pre>