[转]:iOS中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];

 

posted @ 2013-08-03 15:28  windworship  阅读(2170)  评论(0编辑  收藏  举报