UItableView和UIScrollView的复用问题
在一个宽度为三维屏宽的ScrollView中加入三个UIViewController,在UIControllerView中添加tableView,通过分层图发现tableVIew已经出来了,但是cell出不来,怎么解决冲突,代码如下:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
StoryCellViewModel *model = [ self .contactsobjectAtIndex:indexPath.row];
// 构建cell
FamousViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([FamousViewCellclass])];
if (!cell) {
cell = [[FamousCollectionViewCellalloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:NSStringFromClass([FamousViewCellclass])];
}
cell.model = model;
return cell;
}
这个函数通过打断点,发现根本没有被执行到
查看2道真题和解析
曼迪匹艾公司福利 125人发布