title: I added selectRowAtIndexPath in cellForRowAtIndexpath to mark previous selected row but if scroll tablview it crashs
body: <p>I am making a custom UITableView menu selector component. Every time I selected a specific row, I save this row's indexpath, so the next time when a user to select another row, people can know his previous selected row. So I added this into cellForRowAtIndexpath</p>
  
  <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  {
      static NSString *cellIdentifier = @"Cell";
      UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier forIndexPath:indexPath];
  
      cell.textLabel.text = self.left[indexPath.row][@"name"];
      [tableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:[[[NSUserDefaults standardUserDefaults] objectForKey:kPreviousSelectedRow] integerValue] inSection:0] animated:YES scrollPosition:UITableViewScrollPositionNone];
      cell.selectionStyle = UITableViewCellSelectionStyleGray;
      cell.textLabel.highlightedTextColor = [UIColor grayColor];
      return cell;
  }
  </code></pre>
  
  <p>and when the user select another row, save this row to :[[[NSUserDefaults standardUserDefaults] objectForKey:kPreviousSelectedRow], so next time he can see his previous selected row.</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      [[NSUserDefaults standardUserDefaults] setObject:[NSNumber numberWithInt:indexPath.row] forKey:kPreviousSelectedRow];
  }
  </code></pre>
  
  <p>The crash log: index is [[[NSUserDefaults standardUserDefaults] objectForKey:kPreviousSelectedRow] integerValue] and count is numberOfRows. As you can see, it shouldn't out of bounds. I don't know where the [0...6] come from.</p>
  
  <pre><code>2013-08-23 21:01:26.107 [17605:c07] index:10, count:14
  2013-08-23 21:01:26.173[17605:c07] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 7 beyond bounds [0 .. 6]'
  </code></pre>
  
  <p>EDITED:And If I scroll the tableview slow, it won't crash, if I scroll it fast, it crashes. what?</p>