title: At canEditRowAtIndexPath Method, reloadData of UITableView not work properly?
body: <p>In my application, I reload my TableView <em>(<code>[tablView reloadData];</code>)</em> after delete row from TableView then <code>canEditRowAtIndexPath</code> Method alway call for <strong>(pervious)</strong> total number Of Rows.</p>
  
  <p><strong>For Example:</strong></p>
  
  <p>If i have <strong>5</strong> Rows on my TableView, then i delete <strong>1</strong> row from tableView. After deleting, I <strong>reload</strong> my TableView <em>(<code>[tablView reloadData]</code>)</em> but <code>canEditRowAtIndexPath</code> Method calls <strong>5 time</strong>  instead of <strong>4 times</strong> ?? </p>
  
  <p>So i always got Following <strong>Error:</strong></p>
  
  <blockquote>
    <p>Terminating app due to uncaught exception 'NSRangeException', <strong>reason:</strong> '<strong>* **-[__NSArrayM objectAtIndex:]: index 5 beyond bounds [0 .. 4]'</strong></p>
  </blockquote>
  
  <p>I also tried to reload table after some delay (using <code>NSTimer</code>) but it also not worked for me.</p>
  
  <p><strong>I put some code here:</strong></p>
  
  <p>I apply <code>canEditRowAtIndexPath</code> on specific row which <code>@"status" isEqualToString:@"directory"</code> such like,</p>
  
  <pre><code>- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSLog(@"%d", self.listOfSounds.count);
      // Return NO if you do not want the specified item to be editable.
      if([[[self.listOfSounds objectAtIndex:indexPath.row] objectForKey:@"status"] isEqualToString:@"directory"])
          return YES;
      else
          return NO;
  }  
  </code></pre>
  
  <p>Code of delete row:</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
  {
  
      if (editingStyle == UITableViewCellEditingStyleDelete)
      {
          [self.sql_ deleteSoundFileAudioTableWhereMainID:[[self.listOfSounds objectAtIndex:indexPath.row] objectForKey:@"main_id"]]; /// delete record from DB
          [self.listOfSounds removeObjectAtIndex:indexPath.row]; /// delete record from Array
          [self updateListofSoundsFile]; /// Custom method
      }
  }
  
  - (BOOL)tableView:(UITableView *)tableView shouldIndentWhileEditingRowAtIndexPath:(NSIndexPath *)indexPath
  {
      return NO; // i also tried to  return YES;
  }
  </code></pre>
  
  <p>Here <code>updateListofSoundsFile</code> is my custom method code is :</p>
  
  <pre><code>-(void)updateListofSoundsFile
  {
      if(self.listOfSounds.count &gt; 0)
          [self.listOfSounds removeAllObjects];
  
      self.listOfSounds = [self.sql_ getAllDataFromAudioTable]; // get all record from DB
      NSLog(@"%d",self.listOfSounds.count);
  
      [self.tblView reloadData];  
  }
  </code></pre>
  
  <p>Please Give any suggestion, How can i solve this issue ?<br>
  Thanks :)</p>