This is my code
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
NSArray *selectedRows=[_mytableview indexPathsForSelectedRows];
NSMutableArray *rownumberArray=[[NSMutableArray alloc]init];
NSMutableArray *valueofselectedcell = [[NSMutableArray alloc]init];
for (int i=0; i<selectedRows.count; i++) {
customcell *cell = (customcell *)[_mytableview cellForRowAtIndexPath:indexPath];
NSString *test = cell.balance.text;
[valueofselectedcell addObject:test];
NSArray *array = [valueofselectedcell copy];
NSNumber* sum = [array valueForKeyPath: @"@sum.self"];
NSLog(@"the sum valuie is .... %@",sum);
NSString *totalamount = [sum stringValue];
_amountlabel.text=totalamount;
NSIndexPath *path = [tableView indexPathForSelectedRow];
NSLog(@"%@ the selected path value is",path);
}}
when the table cell values are selected the selected values are store in the valueselectedcell array it's working fine.Now how to remove the values in the array when i deselect the rows .