title: Where to put UITableViewDelegate and DataSource in MVC?
body: <p>In terms of MVC, I have a UITableView that is instantiated in my controller and a model object that acts as a UITableViewDelegate &amp; UITableViewDataSource. When I came to setting the delegate and datasource I just added both to point to the model:</p>
  
  <pre><code>    // INSIDE CONTROLLER
  [tableView setDelegate:dataModel];
  [tableView setDataSource:dataModel];
  </code></pre>
  
  <p>The DataSource fits in the model, that feels right. But the delegate, is that best in the model (so its with the DataSource) or would that (in MVC terms) fit better in the controller?</p>
  
  <pre><code>    // INSIDE CONTROLLER
  [tableView setDelegate:self];
  [tableView setDataSource:dataModel];
  </code></pre>
  
  <p><strong>EDIT:</strong> <em>I should clarify that my model objects contains an NSMutableArray that holds the data I wish to display in the UITableView (hence my setting the DataSource to the model). This seems to work well as I can populate the UITableView directly from the model.</em></p>