2012-06-04 155 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