【发布时间】:2010-10-21 13:29:41
【问题描述】:
如何在滑动时删除 UITableView 行?我知道问题已被提出,但我只得到错误。代码如下:
-(void)tableView:(UITableView*)tableView willBeginEditingRowAtIndexPath:(NSIndexPath *)indexPath {
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle
forRowAtIndexPath:(NSIndexPath *)indexPath {
// If row is deleted, remove it from the list.
if (editingStyle == UITableViewCellEditingStyleDelete) {
NSInteger row = [indexPath row];
[tableDataSource removeObjectAtIndex:row];
}
}
但是什么也没发生。如果您编写代码,我将不胜感激。
【问题讨论】:
标签: iphone uitableview ios