Question: I implemented the UITableView in my iPhone application. Further more I added multiple selection of row in UITableView.But the problem is that when I select particular row and then scrolls table and come back then respective row in unselected(unmarked).Here is my didSelectRowAtIndexPath method.

```
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath     *)indexPath
{

        [tableView deselectRowAtIndexPath:indexPath animated:YES];
        if([tableView cellForRowAtIndexPath:indexPath].accessoryType==UITableViewCellAccessoryNone)
        {  
            [tableView cellForRowAtIndexPath:indexPath].accessoryType=UITableViewCellAccessoryCheckmark;        
            [selectedIndexes addObject:[NSNumber numberWithInt:indexPath.row]];
            NSLog(@"Select now %d",[selectedIndexes count]);
        }
        else if([tableView cellForRowAtIndexPath:indexPath].accessoryType==UITableViewCellAccessoryCheckmark)
        {
            [tableView cellForRowAtIndexPath:in dexPath].accessoryType=UITableViewCellAccessoryNone;
            [selectedIndexes removeObject:[NSNumber numberWithInt:indexPath.row]];
            NSLog(@"DeSelect now %d",[selectedIndexes count]);
        }   
}

```

Please provide me solution.

Answer: 
While you are scrolling the table view every time,the delegate method cellForRowAtIndexPath method is called every time..So,it will load the data every time.Means, first you have to store which rows are clicked in didSelectRowAtIndexPath method, and according to these rows indexes in cellForRowAtIndexPath method you have to show that which table view rows are already selected with check marks and for remaining rows with out check mark...
check this. [multiple-row-selection-and-editing](http://www.cocoawithlove.com/2009/01/multiple-row-selection-and-editing-in.html)

You will find really easy & usefull.

Enjoy Programming