2010-11-07 75 views
0

當我調用該方法時,我的UITableViewCell不會刪除。我可以打印出它應該刪除的單元格,但它不會自行刪除,也不會從陣列中刪除它自己。我的UITableViewCell不會刪除

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { 

    UITableViewCell *thisCell = [tableView cellForRowAtIndexPath:indexPath]; 
    [customData removeObjectIdenticalTo:thisCell.textLabel.text]; 
    NSLog(@"%@", customData); 
    [thisCell removeFromSuperview]; 
    [tabler reloadData]; 
} 

回答

2

你需要這個:[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];