Como seleciono várias linhas da tabela dos resultados filtrados de uma barra de pesquisa e um SearchDisplayController?

Entendo que o UISearchDisplayController foi reprovado no iOS 8.0, mas não há muita documentação boa sobre o novo UISearchController, então usei o primeiro. Tenha paciência comigo.

No momento, estou usando arquivos XIB. Eu sei que, para uma tableview regular, você pode permitir a seleção de várias células dentro do XIB e selecionando Seleção múltipla no menu suspenso em "Seleção".

Mas como tornar isso possível nos resultados da pesquisa filtrada de um UISearchBar? Eu entendo que tecnicamente, eu tenho duas visualizações de tabletes separadas basicamente.

Nesse cenário, posso usar a seleção de várias células na visualização de tabela normal (quando não estou usando o filtro), mas não posso fazê-lo na visualização de tabela do filtro. O que eu fiz para a tableview regular é apenas permitir "seleção múltipla" no XIB. Eu não tenho idéia de como fazer isso para o filtro-tableview.

Abaixo está todo o código relevante que compõe minha tableview e barra de pesquisa.

    #pragma mark Search Bar Methods

- (void)filterContentForSearchText:(NSString*)searchText scope: (NSString *) scope
{
    NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"firstName BEGINSWITH[c] %@", searchText];
    self.searchResults = [[self.tbContactsGrabber.savedArrayOfContactsWithPhoneNumbers filteredArrayUsingPredicate:resultPredicate]mutableCopy];
}


- (BOOL) searchDisplayController:(UISearchDisplayController *)controller shouldReloadTableForSearchString:(NSString *)searchString {
    [self filterContentForSearchText:searchString scope:[[self.searchDisplayController.searchBar scopeButtonTitles]objectAtIndex:[self.searchDisplayController.searchBar selectedScopeButtonIndex]]];

    return YES;
}

- (void)searchDisplayController:(UISearchDisplayController *)controller didHideSearchResultsTableView:(UITableView *)tableView {
    [tableView reloadData];
    [self.tableView reloadData]; //these two lines make sure that both Filterview and Tableview data are refreshed - without it, it doesn't work

}



#pragma mark Tableview Delegate Methods
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    if (tableView == self.searchDisplayController.searchResultsTableView) {
        return [self.searchResults count];
    }
    else {
        return (self.tbContactsGrabber.savedArrayOfContactsWithPhoneNumbers.count);
    }
}


- (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];

    if(!cell){
        cell =
        [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
    }

    Contact *selectedContact;
    if (tableView == self.searchDisplayController.searchResultsTableView){
    //if we are in filter search results view
        selectedContact = [self.searchResults objectAtIndex:indexPath.row];
        if (selectedContact.checkmarkFlag == YES) {
            cell.accessoryType = UITableViewCellAccessoryCheckmark;
        }
        else if (selectedContact.checkmarkFlag == NO) {
            cell.accessoryType = UITableViewCellAccessoryNone;
        }
    }
    else {
    //if we are in regular table view
        selectedContact = [self.tbContactsGrabber.savedArrayOfContactsWithPhoneNumbers objectAtIndex:indexPath.row];
        if (selectedContact.checkmarkFlag == YES) {
            cell.accessoryType = UITableViewCellAccessoryCheckmark;
        }
        else if (selectedContact.checkmarkFlag == NO) {
            cell.accessoryType = UITableViewCellAccessoryNone;
        }
    }

    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    //to make sure there's no gray highlighting when it's clicked - important

    NSString *fullName = [NSString stringWithFormat:@"%@ %@", selectedContact.firstName, selectedContact.lastName];
    cell.textLabel.text = fullName;
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    Contact *selectedContact;

    //if its filterview mode
    if (tableView == self.searchDisplayController.searchResultsTableView){

        selectedContact = [self.searchResults objectAtIndex:indexPath.row];
            if (selectedContact.checkmarkFlag == YES) {
            selectedContact.checkmarkFlag = NO;
            cell.accessoryType = UITableViewCellAccessoryNone;
            [self.selectedContacts removeObject:selectedContact];
        }
        else {
            selectedContact.checkmarkFlag = YES;
            cell.accessoryType = UITableViewCellAccessoryCheckmark;
            [self.selectedContacts addObject:selectedContact];
        }
    }

    //if its just regular tableview mode, and you selected something
    else {
        selectedContact = [self.tbContactsGrabber.savedArrayOfContactsWithPhoneNumbers objectAtIndex:indexPath.row];
        selectedContact.checkmarkFlag = YES;
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
        [self.selectedContacts addObject:selectedContact];
    }

    NSLog(self.selectedContacts.description);
}


- (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
    Contact *selectedContact;
    selectedContact = [self.tbContactsGrabber.savedArrayOfContactsWithPhoneNumbers objectAtIndex:indexPath.row];
    selectedContact.checkmarkFlag = NO;
    cell.accessoryType = UITableViewCellAccessoryNone;
    [self.selectedContacts removeObject:selectedContact];

    NSLog(self.selectedContacts.description);
}

questionAnswers(2)

yourAnswerToTheQuestion