在我的项目,我通过继承UITableViewCell
创建自定义细胞。当cellForRowAtIndexPath:
被激发我做的一个非常基本的东西,如:配置自定义的UITableViewCell
MyCustomCell *cell = [self.tableView dequeueReusableCellWithIdentifier:[MyCustomCell identifier]];
我不想在cellForRowAtIndexPath:
手动配置单元格属性,所以我想我会创建内部MyCustomCell
的方法称为configureWithModel:
这与正确填写MyCustomCell
数据。到现在为止还挺好!现在里面cellForRowAtIndexPath:
我有类似:
MyCustomCell *cell = [self.tableView dequeueReusableCellWithIdentifier:[MyCustomCell identifier]];
[cell configureWithModel:model];
在configureWithModel:
我一些数据(图像也)分配给细胞,从而你猜它可能是slow'n'heavy所以我不知道如果这是一个很好的解决方案在MyCustomCell
的子类中有这样的方法?更重要的是,它与prepareForReuse
有什么关系?