title: Custom TableViewCells on a UIViewController?
body: <p>I am trying to display a custom TableView on a UIViewController but am getting an error "UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:"</p>
  
  <p>I had connected the TableView to datasource and delegate. </p>
  
  <p>Any suggestion to go about implementing so or do I need a UITableViewController?</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
  static NSString *CellIdentifier = @"CustomCell";
  
  CustomCell *cell = (CustomCell *)
                      [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
  if (cell == nil) {
      NSArray *topLevelObjects = [[NSBundle mainBundle]
                                  loadNibNamed:@"CustomCell"
                                  owner:nil options:nil];
      for (id currentObjects in topLevelObjects){
          if ([currentObjects isKindOfClass:[UITableView class]]){
              cell = (CustomCell *) currentObjects;
              break;
          }
      }                           
  }
  //---set the text to display for the cell---
  cell.cellNameLabel.text = @"This is name";
  cell.cellValueLabel.text = @"This is Value";
  return cell;
  </code></pre>