title: How to limit the multi selection in UITableViewController
body: <p>Here are tableView data source and delegate implementation, and I set the maximum selection is 5.</p>
  
  <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      ...
      if ([multiOptions count] &gt; 5) {
          [self tableView:tableView didDeselectRowAtIndexPath:indexPath];
          cell.accessoryType = UITableViewCellAccessoryNone;
          cell.selected = NO;
          //show alert
      }
      ...
  }
  
  - (void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
  {
      ...
      [multiOptions removeObject:selectedOption];
      ...
  }
  </code></pre>
  
  <p>but here comes a question, if the options exceed the limit, the first click on cell will work just fine. but second time click the cell will call </p>
  
  <pre><code>didDeselectRowAtIndexPath
  </code></pre>
  
  <p>again, that's not what i expected, and I tried</p>
  
  <pre><code>[tableView deselectRowAtIndexPath:indexPath animated:YES];
  </code></pre>
  
  <p>in didSelectRowAtIndexPath, it didn't work, can someone give me a hint, how to correct it? thanks.</p>