我知道这听起来可能是个愚蠢的问题,但我已经到处找了.我该怎么做?
我知道如何使用swype to delete方法来实现这一点,但在该函数之外我如何实现它呢?
请发布一些代码示例.
谢谢
我知道这听起来可能是个愚蠢的问题,但我已经到处找了.我该怎么做?
我知道如何使用swype to delete方法来实现这一点,但在该函数之外我如何实现它呢?
请发布一些代码示例.
谢谢
[self.tableView beginUpdates];
[self.tableView insertRowsAtIndexPaths:insertIndexPaths withRowAnimation:UITableViewRowAnimationFade];
[self.tableView deleteRowsAtIndexPaths:deleteIndexPaths withRowAnimation:UITableViewRowAnimationFade];
[self.tableView endUpdates];
insertIndexPaths
是要插入到表中的NSINDExpatharray.
deleteIndexPaths
是要从表中删除的NSINDExpatharray.
索引路径的数组格式示例:
NSArray *insertIndexPaths = [[NSArray alloc] initWithObjects:
[NSIndexPath indexPathForRow:0 inSection:0],
[NSIndexPath indexPathForRow:1 inSection:0],
[NSIndexPath indexPathForRow:2 inSection:0],
nil];