title: UITableViewController vs UITableView
body: <p>I have 2 Controllers within one app as I am trying out these different settings.</p>
  
  <p>One is a UITableViewController which the way I understand has the Delegate and the Datasource are drawn from the Superclass.</p>
  
  <p>Now going by that theory I now also have a UIViewController with a UITableView on it and in the header file I have declared the Datasource and the Delegate.</p>
  
  <p>So far so Good:-)</p>
  
  <p>Now this is the bit I do not get:</p>
  
  <p>In the implementation file I can use the tableView pointer to link data, but I am using Core Data and I have this piece of code amongst others:</p>
  
  <pre><code>- (void)controllerWillChangeContent:(NSFetchedResultsController *)controller
    {   
    [self.tableView beginUpdates];
    }
  </code></pre>
  
  <p>This and 5 other situations give an error on the UIViewController if I do not setup a</p>
  
  <pre><code>IBOutlet UITableView *tableView;
  </code></pre>
  
  <p>Of course it is synthesized:-)</p>
  
  <p>But if I declare this tableView I get a warning for a double up on the line that says this:</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
  {
  UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Cell"];
  [self configureCell:cell atIndexPath:indexPath];
  return cell;
  }
  </code></pre>
  
  <p>because it also declares a tableView.</p>
  
  <p>So I have 2 questions:</p>
  
  <p>1) Why do I have to set the IBOutlet if I have set a UITableViewDatasource and Delegate?</p>
  
  <p>2) If I give the UITableViewCell a different pointer name - like tableView2, why can I not see the changes upon editing the data, but only see the result after relaunching the app?</p>
  
  <p>The MasterViewController, which is the UITableViewController has not got this option.</p>
  
  <p>Cheers Jeff</p>
  
  <p>---ADDING IMAGES----</p>
  
  <p><img src="https://i.stack.imgur.com/hdI1w.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/Vyr9a.png" alt="enter image description here"></p>
  
  <hr>
  
  <p>To get into edit mode i have this code in the viewDidLoad</p>
  
  <pre><code>self.navigationItem.leftBarButtonItem = self.editButtonItem;
  </code></pre>
  
  <p>and I use this code to action what needs to be done:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  </code></pre>
  
  <p>{
      if (editingStyle == UITableViewCellEditingStyleDelete) {
          NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
          [context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]];</p>
  
  <pre><code>    NSError *error = nil;
      if (![context save:&amp;error]) {
          // Replace this implementation with code to handle the error appropriately.
          // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 
          NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
          abort();
      }
  }   
  }
  </code></pre>
  
  <p>Now the + option works, but I only see the result after I relaunch the app. I can swipe and delete, but again it does not animate live within the same instance of the app.</p>