title: how to use custom cell view class with search bar?
body: <p>I am using search bar and display controller with my view controller. Everything is working  fine when i use default <code>UITableViewCell</code>. But when i use custom cell with controller . It doesn't display text on dragged label.</p>
  
  <p>This code is working correct-</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:  (NSIndexPath *)indexPath
  
  {
      static NSString *CellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell==nil) {
          cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
      }
  
      if (tableView == self.searchDisplayController.searchResultsTableView) {
          cell.textLabel.text = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"userName"];
      }
  
      return cell;
  }
  </code></pre>
  
  <p>Now i have assign that prototype cell with a class named <code>SearchFriendCell</code> and identifier <code>SearchFriends</code>. The <code>SearchFriendCell</code> Class contains a label with a outlet.
  Now if i replace the above code with following Code , it doesn't show any result.</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"SearchFriends";
      SearchFriendCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell==nil) {
          cell = [[SearchFriendCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
      }
  
      if (tableView == self.searchDisplayController.searchResultsTableView) {
          cell.friendName.text = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"userName"];// this line doesn't work
      }
  
      return cell;
  }
  </code></pre>
  
  <p>In the modified code if i replace commented line with following line, it display result-</p>
  
  <pre><code>cell.textLabel.text = [[searchResults objectAtIndex:indexPath.row] objectForKey:@"userName"];
  </code></pre>
  
  <p>I don't know what is the problem here. Search bar display controller is not recognising my prototype cell. Before that i have used table view controller many times but i didn't get such type of problem.
  Help me with some good answers.  </p>