title: How can you get the selected rows from a UITableView?
body: <p>So I've written this code to put a checkmark beside a row that I want selected because I want multiple selected rows</p>
  
  <pre><code>UITableViewCell *cell = [tableView cellForRowAtIndexPath:path];
  
  if (cell.accessoryType == UITableViewCellAccessoryCheckmark) {
      cell.accessoryType = UITableViewCellAccessoryNone;
  } else {
      cell.accessoryType = UITableViewCellAccessoryCheckmark;
  }
  </code></pre>
  
  <p>but when I use the method:</p>
  
  <pre><code>NSArray *selectedIndexPaths = [self.LightsView indexPathsForSelectedRows];
  </code></pre>
  
  <p>it only gets the last row that I clicked on.  Is the checkmark not selecting it?</p>