title: app crashes when deleting an object from core data in iphone
body: <p>I have populated a table view with some data from server and saved it to the core data.Now i have to delete the object from the core data when the user clicks on  the delete option in the table view.
  What i have tried is this:`</p>
  
  <pre><code>-(void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath   
  {
      NSError *error; 
      [[Server serverInfo].context deleteObject:[self.couponList objectAtIndex:indexPath.row]];
      if(![ [Server serverInfo].context  save:&amp;error]) {
          // Handle error
          NSLog(@"Unresolved error series %@, %@", error, [error userInfo]);
      }
      [self.couponList removeObjectAtIndex:indexPath.row];
      [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath]
                       withRowAnimation:UITableViewRowAnimationFade];
      if ([self.couponList count]==0) {
          [self.table setEditing:NO animated:YES];
          [self.editBt setStyle:UIBarButtonItemStyleBordered];
      }
  
  }
  </code></pre>
  
  <p>`
  But it gives an exception and crashes.This is i am getting in the log :"Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'An NSManagedObjectContext cannot delete objects in other contexts".'Can anyone solve this?Thanks in advance</p>