我想使用情节提要板创建custom UITableViewCell
,当我运行程序时,它崩溃了,这里是日志:
***由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'UITableView(; animations = {position =;}; layer =; contentOffset:{0,0}; contentSize:{375,304.23076923076923}>)无法获取来自其dataSource()的单元格”
我只是使用其标识符获取tableviewcell:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ThemeCell *cell = [tableView dequeueReusableCellWithIdentifier:@"themecell"];
return cell;
}
这是我的情节提要中的一些限制:
1)确保使用正确的tableviewcell标识符。2)然后,执行以下操作:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
ThemeCell *cell = (ThemeCell *)[tableView dequeueReusableCellWithIdentifier:@"themecell"];
return cell;
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句