读书人

UITableView刷新单行数据的步骤

发布时间: 2013-01-04 10:04:14 作者: rapoo

UITableView刷新单行数据的方法

我们都知道[tableView reloadData];可以将整个tableview的数据刷新,但有些时候我们可能只更改了某一行或多行的数据,不想全部重新来过,怎么办呢?

这就要用到下面这个方法了。

- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation NS_AVAILABLE_IOS(3_0);

示例代码如下:

NSIndexPath *indexPath_1=[NSIndexPath indexPathForRow:1 inSection:0];

NSArray *indexArray=[NSArray arrayWithObject:indexPath_1];

[regTableView reloadRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationAutomatic];


详细请点击本人博客

读书人网 >移动开发

热点推荐