欢迎光临朱凯的个人博客!
朱凯,a3.work

UITableViewCell不重用代码

 发布时间: 2020-04-17 17:43      原创:  朱凯      评论: .       .人查看

需求: Cell不重用

思路: 让每个cell的标识都不一样,缺点:显示内容比较多时内存占用也是比较多

代码:

// static NSString *reuseID = @"testCell";
NSString *reuseID = [NSString stringWithFormat:@"cell%ld%ld",(long)indexPath.section,(long)indexPath.row];
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:reuseID];
...

转载请注明来源:   UITableViewCell不重用代码  - 朱凯博客

上一篇:iOS定位顶部显示蓝条 下一篇:没有了
分享是一种快乐,也是一种美德:
¥打开支付宝,扫码领红包¥ 红包

支付宝 aliPay

微信 wxPay