ios 刷新UITableView中某一个section或者cell

- (void)updateCPUInfo:(NSTimer *)timer {
    // section刷新
    NSIndexSet *indexSet = [[NSIndexSet alloc] initWithIndex:5];
    [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationNone];
    
    // cell刷新
    NSIndexPath *indexPath1 = [NSIndexPath indexPathForRow:1 inSection:5];
    NSIndexPath *indexPath2 = [NSIndexPath indexPathForRow:2 inSection:5];
    [self.tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath1, indexPath2, nil] withRowAnimation:UITableViewRowAnimationNone];
}

你可能感兴趣的:(ios 刷新UITableView中某一个section或者cell)