title: Add UISearchBar programmatically to a programmatically added UITableView in a normal ViewController
body: <p>I have a very special request. No tutorial or already asked questions worked for me due to not the same scenario. Its special because i want to enhance an existing app without reprogramming all of the code.</p>
  
  <p>I want to programmatically add a UISearchbar.
  The Searchbar should be added to a UITableView which is programmatically added too.</p>
  
  <p>This all takes place in a normal UIViewController.</p>
  
  <p>My current approach displays the Searchbar but it does not search within my UITableView.
  Simply nothing happens.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>myTableView    =   [[UITableView alloc] initWithFrame:self.view.bounds style:UITableViewStyleGrouped];
  
  UISearchBar *searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
  searchBar.delegate = self;
  
  myTableView.tableHeaderView = searchBar;
  
  UISearchDisplayController *searchController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
  searchController.searchResultsDataSource = self;
  searchController.searchResultsDelegate = self;
  searchController.delegate = self;
  
  myTableView.dataSource      =   self;
  myTableView.delegate        =   self;
  
  [self.view addSubview:myTableView];
  </code></pre>