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?
Asked
Active
Viewed 150 times
2 Answers
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
-
for example you can add a checkBox as in Mail application – iArezki Jun 04 '12 at 10:28
-
http://stackoverflow.com/questions/5368196/how-create-simple-checkbox to manage a checkBox – iArezki Jun 04 '12 at 10:28
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