title: IOS - cellForRowAtIndexPath skip row
body: <p>Basically, the <code>cellForRowAtIndexPath</code> function need to return a UITableViewCell. In my code, I would like to check a behaviour that will check something and skip the cell if a specific value is found.</p>
  
  <p>Here's what I have right now :</p>
  
  <pre><code>static NSString *FirstCellIdentifier = @"First Custom Cell";
  static NSString *SecondCellIdentifier = @"Second Custom Cell";
  
  CustomObject *o = [_customObjects objectAtIndex:indexPath.row];
  
  if ([s.name isEqualToString:@""])
  {
      FirstCellController *cell = [customList dequeueReusableCellWithIdentifier:FirstCellIdentifier];
      if (!cell) { 
          NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"FirstCustomCell" owner:self options:nil];
          for (id currentObject in topLevelObjects){
              if ([currentObject isKindOfClass:[UITableViewCell class]]){
                  cell = (FirstCellController *) currentObject;
                  break;
              }
          }
      }
      // Here I do something with the cell's content
      return cell;
  }
  else {
      SecondCellController *cell = [customList dequeueReusableCellWithIdentifier:SecondCellIdentifier];
      if (!cell) {
          NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"SecondCustomCell" owner:self options:nil];
          for (id currentObject in topLevelObjects){
              if ([currentObject isKindOfClass:[UITableViewCell class]]){
                  cell = (SecondCellController *) currentObject;
                  break;
              }
          }
      }
      // Here i do something with the cell's content
      return cell;
  }
  </code></pre>
  
  <p>What I'd like to do is that if the <code>s.name</code> is not empty, I would like to "skip" the cell, not displaying it and go to the next one.</p>
  
  <p>Anyone have some advice on this please ?</p>
  
  <p>Thanks.</p>