IOS UITableView reload 刷新某一个cell 或 section

通常刷新整个列表 我们都使用[self.tableView reloadData];

有的时候,有变化更新的只是某一行 row 或者是某个section 所以只更新这一行就好了

//一个section刷新
int section_index=10;//更新第11个sectioin
[self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section_index] withRowAnimation:UITableViewRowAnimationNone];
//一个cell刷新    
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];  //更新 第一个section的第4行  
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  

 

posted on 2015-01-05 11:41  ACM_Someone like you  阅读(1938)  评论(0编辑  收藏  举报

导航