1. 程式人生 > >ios開發之--tableview刷新某一個區和某一行

ios開發之--tableview刷新某一個區和某一行

anim ios開發 xpath set nsa sat array 代碼 tableview

在開發中,有時候,我們不需要刷新整個表,只需要刷新局部數據即可,具體代碼如下:

//section刷新    
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];    
[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];    
//cell刷新    
NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];    
[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  

這裏僅做記錄!

ios開發之--tableview刷新某一個區和某一行