title: Table View Did Select Row
body: <p>So i have a tableView with checkmark accessory type and I have such method: </p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      NSUInteger newRow = [lastIndexPath row];
      NSUInteger oldRow = (lastIndexPath != nil) ? [lastIndexPath row] : -1;
  
      if (newRow != oldRow) {
          UITableViewCell *newCell = [tableView cellForRowAtIndexPath:indexPath];
          newCell.accessoryType = UITableViewCellAccessoryCheckmark;
  
          UITableViewCell *oldCell = [tableView cellForRowAtIndexPath:lastIndexPath];
          oldCell.accessoryType = UITableViewCellAccessoryNone;
          lastIndexPath = indexPath;
      }
      [tableView deselectRowAtIndexPath:indexPath animated:YES];
  }
  </code></pre>
  
  <p>And it seems to work fine for the first time, but when I select the row for the second time it throws me out and says EXC_BAD_ACCESS. and when I switch the simulator to 4.3, it selects the row only ones and then doesn't work. Can anybody help?</p>