![](/img/trans.png)
[英]'NSInternalInconsistencyException' reason: 'Could not load NIB in bundle' when dequeuing tableview cell
[英]NSInternalInconsistencyException when customize tableview cell in storyboard
我想使用情节提要创建自定义UITableViewCell
,然后在运行程序时崩溃,这是日志:
***由于未捕获的异常“ NSInternalInconsistencyException”而终止应用程序,原因:“ UITableView(;动画= {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;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.