title: NSMutableArray removeObjectAtIndex: throws invalid argument exception
body: <p>I'm writing an application to show some news from a portal. The news are fetched using a JSON file from the Internet and then stored into a NSMutableArray using the CoreData Model. Obviously a user can't delete the news from the JSON file on the Internet, but he can hide them locally. The problems come out here, where I have the following code:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {    
  if (editingStyle == UITableViewCellEditingStyleDelete) {
      if( !moc ){
          moc = [[NewsFetcher sharedInstance] managedObjectContext];
      }
      [[dataSet objectAtIndex:indexPath.row] setEliminata:[NSNumber numberWithBool:YES]];
      NSError *error;
      if( ![moc save:&amp;error] ){
          NSLog( @"C'è stato un errore!" );
      }
      [dataSet removeObjectAtIndex:indexPath.row];
      [self.tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:YES];
  }   
  </code></pre>
  
  <p>The line:</p>
  
  <blockquote>
    <p>[dataSet
    removeObjectAtIndex:indexPath.row];</p>
  </blockquote>
  
  <p>cause my apps to crash with the following error:</p>
  
  <blockquote>
    <p>2010-07-12 19:08:16.021
    ProvaVideo[284:207] <strong>* -[_PFArray
    removeObjectAtIndex:]: unrecognized
    selector sent to instance 0x451c820
    2010-07-12 19:08:16.022
    ProvaVideo[284:207] *</strong> Terminating
    app due to uncaught exception
    'NSInvalidArgumentException', reason:
    '*** -[_PFArray removeObjectAtIndex:]:
    unrecognized selector sent to instance
    0x451c820'</p>
  </blockquote>
  
  <p>I'm trying to understand why it doesn't work but I can't. 
  If I re-launch the app, the new is correctly logically cancelled.
  Any suggestions?? Thanks in advance.</p>
  
  <hr>
  
  <p>Interface:</p>
  
  <pre><code>@interface ListOfVideo : UITableViewController &lt;NSFetchedResultsControllerDelegate&gt; { 
      NSMutableArray *dataSet;
  } 
  @property (nonatomic, retain) NSMutableArray *dataSet;
  
  // In the .m file:
  @synthesize dataSet;
  </code></pre>
  
  <p>Initialization in <code>viewDidLoad</code>:</p>
  
  <pre><code>dataSet = (NSMutableArray *) [[NewsFetcher sharedInstance] 
                                  fetchManagedObjectsForEntity:@"News" 
                                  withPredicate:predicate
                                  withDescriptor:@"Titolo"]; 
  [dataSet retain]; 
  </code></pre>
  
  <p><code>updateDatabase</code> ... this is when checking for new news from the net, I add them in the MutableArray:</p>
  
  <pre><code>[dataSet addObject:theNews];
  </code></pre>