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 on 2012-12-20 19:19  流れ星ーー  阅读(135)  评论(0编辑  收藏  举报

导航