2012-06-04 101 views
0

多个小区我具有由具有定制细胞数据库加载表视图。在按钮复选框应出现在每个单元格的表视图。在此之后,我只想从表格视图中删除选中的项目。如何可能?删除从表视图

回答

1

我猜你有一个数组来填充。

所以,你必须从阵列 删除元素的赚了reloadData likeThis

[yourTableView reloadData]; 
+0

是的,但我怎么能选择多个单元格为删除。 –

+0

例如,你可以在Mail应用程序中添加一个复选框作为 – iArezki

+0

http://stackoverflow.com/questions/5368196/how-create-simple-checkbox管理复选框 – iArezki

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