//一个section刷新
NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; //为了避免重新加载时出现不需要的动画(又名“闪烁”) BOOL animationsEnabled = [UIView areAnimationsEnabled]; [UIView setAnimationsEnabled:NO]; [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; [UIView setAnimationsEnabled:animationsEnabled];
//一个或多个cell刷新
NSIndexPath *indexPath1=[NSIndexPath indexPathForRow:2 inSection:0]; NSIndexPath *indexPath2=[NSIndexPath indexPathForRow:1 inSection:2]; //为了避免重新加载时出现不需要的动画(又名“闪烁”) BOOL animationsEnabled = [UIView areAnimationsEnabled]; [UIView setAnimationsEnabled:NO]; [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath1,indexPath2,nil] withRowAnimation:UITableViewRowAnimationNone]; [UIView setAnimationsEnabled:animationsEnabled];