Open alkayoun opened 7 years ago
我看Demo中:
// 获取cell高度调用方法: return [self.tableView cellHeightForIndexPath:indexPath model:model keyPath:@"model" cellClass:[DemoVC9Cell class] contentViewWidth:cellContentViewWith];
会使用kvo调用cell内的setModel方法,将model给cell.model赋值;
小弟不才,习惯使用cellHelper中间人来获取model 和 对应cell,由cellHelper来处理model里的数据,再对cell赋值。(并对cell内的一些操作进行存值) 小弟尽量想让view层和model层相互解耦。 最后请问能否优化相关方法,如有回复小弟林感涕零不知所言~~~~
使用SD另外一个性能较低的方法解决了先
我看Demo中:
// 获取cell高度调用方法: return [self.tableView cellHeightForIndexPath:indexPath model:model keyPath:@"model" cellClass:[DemoVC9Cell class] contentViewWidth:cellContentViewWith];
会使用kvo调用cell内的setModel方法,将model给cell.model赋值;
然后cell内的setModel方法会执行cell内数据赋值并在最后确定bottomView后, 使用[self setupAutoHeightWithBottomView:bottomView bottomMargin:15];方法,自适应cell高度。