Q:

When i scrolling on UITableview,the checkmark of multiple selected rows are disappears.how to solve this?

I want to implement multiple row selection in UITableview.but when i select multiple row with checkmark and scroll down,the checkmarks are disappears when i come back to selected rows section.I have tried many solutions from Stackoverflow but it doesn't work for me.Can you please anyone give me the solution which works for me.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {

        static NSString *simpleTableIdentifier = @"SimpleTableCell";
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];

        if (cell == nil)
        {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
        }
            if([_selectedstatearray containsObject:indexPath]) {
                cell.accessoryType = UITableViewCellAccessoryCheckmark;
            }
            else {
                cell.accessoryType = UITableViewCellAccessoryNone;

            }

        cell.textLabel.text = [statearray objectAtIndex:indexPath.row];
        return cell;

    }

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

        UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
        NSString *cellText = cell.textLabel.text;
        NSLog(@"cellText>>%@",cellText);

        if (cell.accessoryType == UITableViewCellAccessoryCheckmark) {
            [_selectedstatearray removeObject:cellText];
            cell.accessoryType = UITableViewCellAccessoryNone;

        } else {
            [_selectedstatearray addObject:cellText];
            cell.accessoryType=UITableViewCellAccessoryCheckmark;
        }

        NSLog(@"selectedarray>>%@",_selectedstatearray);

        NSString *greeting = [_selectedstatearray componentsJoinedByString:@","];
        NSLog(@"%@",greeting);

        [tableView deselectRowAtIndexPath:indexPath animated:YES];

    }

A:

The problem lies in this piece of code:
if([_selectedstatearray containsObject:indexPath]) {
    cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else {
    cell.accessoryType = UITableViewCellAccessoryNone;
}

You are checking if _selectedstatearray contains the specified indexPath while you store them as NSString [_selectedstatearray addObject:cellText];
Replace the code above with this:
NSString *text = [statearray objectAtIndex:indexPath.row];
if([_selectedstatearray containsObject:text]) {
    cell.accessoryType = UITableViewCellAccessoryCheckmark;
}
else {
    cell.accessoryType = UITableViewCellAccessoryNone;
}

