views:

32

answers:

1

I currently have a UISearchBar and UISearchDisplayController implemented as:

- (void) viewDidLoad {

 videoList = [[NSMutableArray alloc]init];

 //Add the search bar
 aSearchBar = [[UISearchBar alloc] initWithFrame:CGRectZero];
    [aSearchBar sizeToFit];
 aSearchBar.delegate = self;
    aSearchBar.placeholder = @"Search YouTube...";

    self.tableView.tableHeaderView = aSearchBar;

    searchDC = [[UISearchDisplayController alloc] initWithSearchBar:aSearchBar contentsController:self];

    [self performSelector:@selector(setSearchDisplayController:) withObject:searchDC];

    searchDC.delegate = self;
    searchDC.searchResultsDataSource = self.tableView.dataSource;
    searchDC.searchResultsDelegate = self.tableView.delegate;

    [aSearchBar release];
    [searchDC release];

}

When the user types something and hits search, a tableView appears on top of the tableView in the background.

Is there anyway of hiding this 'searchResults tableView' ? (I just want the background table to hold the data..which it currently does).

i.e. is there a property? e.g. searchDisplayController.tableView.visible=NO or similar?

A: 

searchDC.searchResultsTableView.hidden=YES;

dpigera