title: Toggle checkmark between cells with one cell checked by default
body: <p>I have a settings view in my app that I want the user to be able to check between some different settings but only let the user to have one of the options selected at the time.</p>
  
  <p>I got some help throughout this answer: <a href="https://stackoverflow.com/a/5960016/2707185">iPhone :UITableView CellAccessory Checkmark</a></p>
  
  <p>But I'm not able to get it to toggle correctly when I have the first cell checked by default.</p>
  
  <p>This is in my <code>cellForRowAtIndexPath</code></p>
  
  <pre><code>if (indexPath.row == 0)
  {
       // Set the first cell checked by default
       cell.accessoryType = UITableViewCellAccessoryCheckmark;
  }
  else if([self.checkedIndexPath isEqual:indexPath])
  {
       cell.accessoryType = UITableViewCellAccessoryCheckmark;
  }
  else
  {
       cell.accessoryType = UITableViewCellAccessoryNone;
  }
  </code></pre>
  
  <p>This is my <code>didSelectRowAtIndexPath</code></p>
  
  <pre><code>// Uncheck the previous checked row
  if(self.checkedIndexPath)
  {
      UITableViewCell* uncheckCell = [tableView cellForRowAtIndexPath:self.checkedIndexPath];
      uncheckCell.accessoryType = UITableViewCellAccessoryNone;
  }
  
  UITableViewCell* cell = [tableView cellForRowAtIndexPath:indexPath];
  cell.accessoryType = UITableViewCellAccessoryCheckmark;
  self.checkedIndexPath = indexPath;
  
   [tableView deselectRowAtIndexPath:indexPath animated:YES];
  </code></pre>
  
  <p>The cell is checked by default but when checking another cell the first cell is still checked until I check it again and after that check another cell, then the behavior is correct.</p>