title: How to create fixed amount of UITableViewCell and if the data is null then row should be not be shown
body: <p>I am using tableView to display some information which is just four line of information. And i want to assign respective information to each row.
  Like  how shown in the below image there are four rows, same as in the image so i am using tableView for that. Here my problem is that i have created four cells but don't know how should i use label in specific cell and show the info.
  and also if the value is null that row should not be there means if two values among four are null then only two rows having values should be there in tableView. How can i achieve this. Till now i am only able to show one row information only. </p>
  
  <p><a href="https://i.stack.imgur.com/Li6IZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Li6IZ.png" alt="enter image description here"></a></p>
  
  <pre><code>- (NSArray *)myTableViewCells
  {
       if (!_myTableViewCells)
       {
           _myTableViewCells = @[
                                [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil],
                                [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil],
                                [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil],
                                [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil]
  
                                ];
         }
  
         return _myTableViewCells;
  }
  
     if([managedObject valueForKey:@"personality_company_master_values"] != nil)
  {
      [_displayValues addObject:[NSString stringWithFormat:@"Personality    %@",[managedObject valueForKey:@"personality_company_master_values"]]];
  }
   if([managedObject valueForKey:@"video_tag"] != nil)
  {
      [_displayValues addObject:[NSString stringWithFormat:@"Tag                 %@",[managedObject valueForKey:@"video_tag"]]];
  }
  
   if([managedObject valueForKey:@"industry_master_values"] != nil)
  {
      [_displayValues addObject:[NSString stringWithFormat:@"Industry       %@",[managedObject valueForKey:@"industry_master_values"]]];
  }
  
  
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
       return self.myTableViewCells.count;
  }
  
   - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
   {
    UITableViewCell* cell = self.myTableViewCells[indexPath.row];
  
     //   NSManagedObject *managedObject = [self.devices lastObject];
  
       cell.backgroundColor = [self colorFromHexString:@"#014455"];
  
  
     cell.textLabel.text = _displayValues[indexPath.row];
  
     cell.textLabel.backgroundColor = [self colorFromHexString:@"#014455"];
  
     cell.textLabel.textColor = [UIColor whiteColor];
  
     cell.textLabel.font=[UIFont systemFontOfSize:14.0];
  
  
     //  UILabel *lbl=(UILabel*)[cell viewWithTag:900];
  
     //   [lbl setText:[managedObject valueForKey:@"personality_company_master_values"]];
  
     //   lbl.textColor=[UIColor blackColor];
  
  return cell;
    }
  </code></pre>