How to track the index of all seleted cells in UITableView
<p>I have a <code>UITableView</code> with about 20 rows. I also use check mark accessory to identify the selected. The problem I face now is that the selection gets messed up when I scroll (here  I am selecting multiple rows). So after scroll the selected <code>checkmark</code> has vanished.  Can anyone help me to find a way? in <code>didSelectRowAtIndexPath:</code></p>

<pre><code>NSMutableDictionary *rowDict = [tableList objectAtIndex:[indexPath row]];

if([tableView cellForRowAtIndexPath:indexPath].accessoryType == UITableViewCellAccessoryCheckmark)
{

    [tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryNone;

}
else
{
    [tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;

    checkedIndexPath =  indexPath;

    NSLog(@"the checked psths are :%@",checkedIndexPath);

}
</code></pre>

<p>And in <code>cellforrowatIndexpath</code> I use</p>

<pre><code>if([self.checkedIndexPath isEqual:indexPath])
{
    cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else 
{
    cell.accessoryType = UITableViewCellAccessoryNone;
}
</code></pre>

<p>But this works only for single selection.  What should I do for multiple selection?</p>
