UITableview刷新某一个cell或section

时间:2023-02-06 21:18:43

//一个section刷新

NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];

[tableview reloadSections:indexSetwithRowAnimation:UITableViewRowAnimationAutomatic];

//一个cell刷新

NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3inSection:0];

[tableView reloadRowsAtIndexPaths:[NSArrayarrayWithObjects:indexPath,nil]withRowAnimation:UITableViewRowAnimationNone];