title: How to add UITableView to existing view
body: <p>How do I add a UITableView to an existing view?</p>
  
  <p>I have added the control via interface builder, and added the correct delegates to the host view controller (including adding the table cell functions to the .m file)</p>
  
  <p>But nothing gets called and nothing gets populated, the <code>cellForRowAtIndexPath</code> function, for example, never gets called.</p>
  
  <p><strong>in .h file</strong></p>
  
  <pre><code>@interface GameViewController : UIViewController &lt;UITableViewDelegate, UITableViewDataSource&gt; 
  
  @property (weak, nonatomic) IBOutlet UITableView *friendsScoresView;
  </code></pre>
  
  <p><strong>in .m file</strong></p>
  
  <pre><code>init {
      _friendsScoresView.delegate = self;
      _friendsScoresView.dataSource = self;
  }
  
  - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  {
      // return number of rows
      return 3;
  }
  
  - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MyBasicCell"];
      //NSMutableArray *nearbyScores = gclb-&gt;nearbyScores;
  
      GCLeaderboardScore *playerScore = [gclb-&gt;nearbyScores objectAtIndex:indexPath.row];
      cell.textLabel.text = [NSString stringWithFormat:@"%f",playerScore-&gt;score ];
      cell.imageView.image = playerScore-&gt;photo;
      return cell;
  }
  
  - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      // handle table view selection
  }
  </code></pre>
  
  <p>What am I missing? Also how do I tell the table to update / refresh its contents?</p>