iOS之小门道道

1.代理方法不执行

很多时候在你代理方法不执行时,小样,你看看你设置代理了吗?

2.UITableViewCell 没有复用

cell为纯代码:

首先要注册:
' [self.tableView registerClass:[CCMHotArticleCell class] forCellReuseIdentifier:@"hotCell"]; '

再是重写方法:

' -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
//这里配置cell的子视图
[self configSubviews];
}
return self;
}
'

链接

原文地址:https://www.cnblogs.com/YaoJinye/p/5898978.html