uitableview刷新指定section 或 刷新指定 cell (ios)

来源:互联网 发布:司法拍卖淘宝网怎么进 编辑:程序博客网 时间:2024/05/17 23:33


uitableview刷新指定section 或 刷新指定 cell:


 NSUInteger section = self.tableView.numberOfSections - 1; //指定section    //刷整个section    NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:section];    [self.tableView reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];        //还是刷单独的cell    NSInteger rows = [self.tableView numberOfRowsInSection:section];    for (NSInteger row = 0; row < rows; row++) {        NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section];        UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];        if ([cell isKindOfClass:[TableViewFunctionalCell class]]) {//是TableViewFunctionalCell            TableViewFunctionalCell *funcCell = (TableViewFunctionalCell *)cell;        }    }


//一个cell刷新    NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];    [tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];  

0 0