I have a uisearchbar that does a search successfully. The problem is that the searchResultsTableView doesn't show the results because it is using a regular UITableViewCell instead of my custom cell. I have set this custom cell in storyboards and connected the outlets to make sure everything is working properly.
My cellForRowAtIndexPath method looks like this:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"InviteCell"; InviteTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if ( cell == nil ) { cell = [[InviteTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier]; } MyUser *person = nil; if (tableView == self.searchDisplayController.searchResultsTableView) { person = [self.filteredContactArray objectAtIndex:[indexPath row]]; //This works and shows cell.detailTextLabel.text = @"testing if using default cell"; } else { person = [self.inviteContactsArray objectAtIndex:[indexPath row]]; } //InviteTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; person = [self.inviteContactsArray objectAtIndex:indexPath.row]; //these do not work and do not show in the results view cell.nameLabel.text = person.fullName; cell.emailLabel.text = person.email; return cell; } This is what the results view looks like:
