Totally hide search bar
<p>I would like to show a search bar when the user clicks on a search button.  I have found that a lot of people use an offset to hide the search bar on launch.  However, is there a way to really hide it, something like a .hidden property?</p>

<p>This is the offset approach but the search bar is still there just offset out of view temporarily.  I would like it to really disappear unless needed.</p>

<p>I guess the other approach is to create a new view controller and launch that when the search button is clicked but that is additional overhead..especially as I have a number of these tableviews.  Thx for any ideas.</p>

<pre><code>in ViewDidLoad:
 UISearchBar *searchBar;
    searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 70, 320, 44)];
    searchBar.showsCancelButton = YES;
    searchBar.delegate = self;
    self.tableView.tableHeaderView = searchBar;



In viewWillAppear:

[self.tableView setContentOffset:CGPointMake(0.0, self.tableView.tableHeaderView.frame.size.height) animated:YES];
</code></pre>