Note that there are some explanatory texts on larger screens.

plurals
  1. POSearchDisplayControler, UILabel stacking after selection
    primarykey
    data
    text
    <p>I'm trying to implement a searchDisplayController but I've a problem. Once I filtered the cell and when I selected the cell remaining I get a strange stack of text :</p> <p><a href="http://postimage.org/image/4fswe8t8n/" rel="nofollow">http://postimage.org/image/4fswe8t8n/</a></p> <p>It's like having all my cell in one.</p> <p>So there's my cellForRowAtIndexPath method : </p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"MFriendCell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } if(tableView == self.tableView) { UILabel *nameLabel = (UILabel *)[cell viewWithTag:201]; nameLabel.text = [self.allItems objectAtIndex:indexPath.row]; } else if(tableView == self.searchDisplayController.searchResultsTableView) { UILabel *labelName = [ [UILabel alloc ] initWithFrame:CGRectMake(50, 0.0, 150.0, 43.0) ]; labelName.text = [self.searchResults objectAtIndex:indexPath.row]; [cell addSubview:labelName]; } return cell; } </code></pre> <p>And my filter : </p> <pre><code>- (void)filterContentForSearchText:(NSString*)searchText scope:(NSString*)scope { NSPredicate *resultPredicate = [NSPredicate predicateWithFormat:@"SELF contains[cd] %@", searchText]; self.searchResults = [self.allItems filteredArrayUsingPredicate:resultPredicate]; } </code></pre> <p>if you need anything else just ask :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload