J'ai un UISearchDisplayController qui est correctement connecté dans Interface Builder.UISearchDisplayController n'affiche aucune cellule
delegate = Files Owner
searchBar = Search Bar
searchContentsController = Files Owner
searchResultsDataSource = Files Owner
searchResultsDelegate = Files Owner
Quand mon UITableView appelle numberoOfRowsInSection:
le nombre correct est retourné.
Cependant, mes cellules cellForRowAtIndexPath:
n'atteignent même pas:
- (UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (tblView == searchController.searchResultsTableView){
NSLog(@"search will go here");
UITableViewCell* cell = [self provideSearchQueryCells:tblView identifer:@"searchQueryCell"];
STSymbol *aSymbol = [self.searchQueryResults objectAtIndex:indexPath.row];
cell.textLabel.text = aSymbol.symbol;
cell.detailTextLabel.text = aSymbol.symbol_title;
return cell;
}
else { ... }
Il va toujours à la condition d'autre.
Je ne sais pas trop pourquoi.
Je crois que oui, parce que ce code est dans une sous-classe UITableViewController. self.searchResultsTableView n'est pas une propriété dans un UITableViewController. –
J'ai modifié mon message pour montrer comment les délégués sont branchés au BI. –