¿Existe la posibilidad de restablecer una UISearchbar con searchDisplayController programmatically que está activo y que ya contiene texto?Restablecer UISearchbar programmatically
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if (tableView == self.searchDisplayController.searchResultsTableView) {
searchDisplayController.searchResultsTableView.hidden = YES;
searchBar.showsCancelButton = NO;
[searchBar resignFirstResponder];
}
}
Esta solución está funcionando, pero todavía hay texto en la barra de búsqueda. Si agrego esas líneas de código:
searchBar.text = @"";
Siempre queda una vista negra transparente.
¿Alguna solución?
tratar searchBar.text = nil; –