2010-11-07 72 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];