So finally instead of dragging a searchBar control into the storyboard. I'm creating and destroying the searchBarControl on the fly.
-(void)initialiseSearch
{
//Start
searchBar = [[UISearchBar alloc] initWithFrame:CGRectMake(0, 0, 320, 44)];
searchBar.delegate = self;
searchBar.showsCancelButton = YES;
searchDisplayController = [[UISearchDisplayController alloc] initWithSearchBar:searchBar contentsController:self];
searchDisplayController.delegate = self;
searchDisplayController.searchResultsDataSource = self;
searchDisplayController.searchResultsDelegate = self;
[self.view addSubview:searchBar];
searchBar.hidden = YES;
[searchDisplayController setActive:NO animated:NO];
// [self.searchDisplayController.searchResultsTableView registerNib:[UINib nibWithNibName:@"CustomSearch" bundle:[NSBundle mainBundle]] forCellReuseIdentifier:@"search"];
//End
}
The method is called in the view did load.