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

2017-02-04  本文已影响221人  景彧
- (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];
}
上一篇 下一篇

猜你喜欢

热点阅读