0

I have table view which is loading from the database having customize cell. On button checkBox should appeared on each cell of table view . After this i just want to delete the checked items from the table view. How it can be possible?

V-Xtreme
  • 7,230
  • 9
  • 39
  • 79

2 Answers2

1

I guess that you have an array to populate.

So you must delete elements from the array an make a reloadData likeThis

[yourTableView reloadData];
iArezki
  • 1,273
  • 2
  • 17
  • 29
1
Here recording data array is a array of dictionary in which there is a key which keep track of which button is checked or which is unchecked. on clicking Delete button you can use below mentioned concept for deleting more than open array at a go :

USE THIS CONCEPT : 

    - (IBAction)deleteClicked:(id)sender 
    {
        for(int index = 0 ; index < [recordingDataArray count] ; index++)
        {
            NSMutableDictionary *item = [recordingDataArray objectAtIndex:index];
            BOOL checked = [[item objectForKey:@"checkStatus"] boolValue];
            if(checked)
            {
                [recordingDataArray removeObjectAtIndex:index];
                index--;
            }
        }
        [self.recordingTblView reloadData];
    }

THANKS & REGARDS,
GAUTAM TIWARI
iGautam
  • 121
  • 3
  • 9