美文网首页
tableview 重用/单独

tableview 重用/单独

作者: 精神薇 | 来源:发表于2018-02-08 22:46 被阅读0次

    重用

    MonthlyReviewCell * cell = (MonthlyReviewCell *)[tableView dequeueReusableCellWithIdentifier:@"MonthlyReviewCellID"];
    if ( !cell ) {
        cell = [[MonthlyReviewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"MonthlyReviewCellID"];
    }
    

    单独

    NSString *cellIdentifierResult = [NSString stringWithFormat:@"Resultcell%ld%ld", (long)[indexPath section], (long)[indexPath row]];//以indexPath来唯一确定cell
    ResultClientTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifierResult];
    if(nil == cell){
        cell = [[ResultClientTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifierResult];
    }
    

    相关文章

      网友评论

          本文标题:tableview 重用/单独

          本文链接:https://www.haomeiwen.com/subject/zzuxtftx.html