這是我想出來的:如何手動刪除UITableView中的一行?
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:1]; // my table view has 2 sections
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationTop];
每次我建立和運行,它拋出以下異常:
無效更新:在第0的數行數無效更新後現有節中包含的行必須等於更新前該節中包含的行數,加上或減去從該節添加或刪除的行數。
這有點令人困惑。該部分設置爲1,但例外說它是0.
愛你線NSIndexPath * indexPath = [NSIndexPath indexPathForRow:0切入口:1] ;.爲你+1;) – oberbaum 2010-01-28 16:27:55