title: UIsearch Bar Display use in Table view
body: <p>Hello guys i am new in iOS .i am try to solve the error in belove code.
  every thing is working fine but when i am try to search then we get cell nil. i am use customize cell. i got data in filterDict bt cell is nil show. plz help me  </p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *CellIdentifier = @"MyCell";
  
      TableCell *cell = (TableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  
      if (cell == nil)
      {
          cell = [[TableCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier ];
      }
  
      NSDictionary *dic;
      if(tableView == self.searchDisplayController.searchResultsTableView)
      {
  
      key = [searchBarSectionFilterArray objectAtIndex:indexPath.section];
      arrayDictonry = [dict valueForKey:key];
      NSDictionary *filterDict = [arrayDictonry objectAtIndex:indexPath.row];
  
      if([[filterDict valueForKey:@"digiboxStatus"]isEqualToString:@"DEAD"])
      {
          [cell.cellImage setBackgroundColor:[UIColor colorWithRed:245.0/255.0 green:105.0/255.0 blue:84.0/255.0 alpha:1.0]];
      }
      else
      {
          [cell.cellImage setBackgroundColor:[UIColor colorWithRed:0.0/255.0  green:166.0/255.0 blue:90.0/255.0 alpha:1.0]];
      }
  
          [cell.locationNameLable setText:[filterDict valueForKey:@"locTitle"]];
  
      if([[filterDict objectForKey:@"lastseenStr"] isEqual:[NSNull null]] || [[filterDict objectForKey:@"lastseenStr"] isEqualToString:@""])
      {
          TableCell *lable;
  
          [lable.lastSeenTimeLable setHidden:YES];
  
          [cell.lastSeenTimeLable  setText: @"Not Available"];
      }
      else
      {
  
          [cell.lastSeenTimeLable setText:[filterDict valueForKey:@"lastseenStr"]];
  
      }
  
  }
  else
  {
  
      key = [dictArray objectAtIndex:indexPath.section];
      arrayDictonry =  [dict valueForKey:key];
      dic = [arrayDictonry objectAtIndex:indexPath.row];
  
      if([[dic valueForKey:@"digiboxStatus"]isEqualToString:@"DEAD"])
      {
          [cell.cellImage setBackgroundColor:[UIColor colorWithRed:245.0/255.0 green:105.0/255.0 blue:84.0/255.0 alpha:1.0]];
      }
      else
      {
          [cell.cellImage setBackgroundColor:[UIColor colorWithRed:0.0/255.0  green:166.0/255.0 blue:90.0/255.0 alpha:1.0]];    }
  
  
      [cell.locationNameLable setText:[dic valueForKey:@"locTitle"]];
  
      if([[dic objectForKey:@"lastseenStr"] isEqual:[NSNull null]] || [[dic objectForKey:@"lastseenStr"] isEqualToString:@""])
      {
          TableCell *lable;
  
          [lable.lastSeenTimeLable setHidden:YES];
  
          [cell.lastSeenTimeLable  setText: @"Not Available"];
      }
      else
      {
  
          [cell.lastSeenTimeLable setText:[dic valueForKey:@"lastseenStr"]];
  
      }
  }
  return cell;
  
  }
  </code></pre>