title: Deleting a row from tableView and coredata
body: <p>I am retrieving the data from coredata and showing it in tableview. If the user clicks on a row it will navigate to another view (say view 2).</p>
  
  <p>Now, I want to delete a row from the tableview as well as from coredata. I used a code with which, I am able to delete the row. But, when I go to view 2 and come back the record is back there. ( Its getting deleted from coredata but the row and its data is still there until, I reload the view).</p>
  
  <p>This is the code i used.</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
      if (editingStyle == UITableViewCellEditingStyleDelete) 
      {
          NSManagedObjectContext *context = [self.fetchedResultsController managedObjectContext];
          [context deleteObject:[self.fetchedResultsController objectAtIndexPath:indexPath]];
          NSError *error;
          if (![context save:&amp;error]) 
          {
              UIAlertView *alertView = [[UIAlertView alloc]initWithTitle:@"App" message:@"Sorry the Item Cannot be deleted" delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
              [alertView show];
              [alertView release];
          }
      }
  }
  </code></pre>