关于-[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UITableView.m:7962错误的解决

如果此文帮助了您,请点击喜欢或评论,您的支持永远都是我前行的动力.

本人在关于viewController中的添加tableView时一直显示此错误(错误如下),

2016-01-08 17:04:41.647 playerOnline[4502:371177] *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.30.14/UITableView.m:7962
2016-01-08 17:04:41.662 playerOnline[4502:371177] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UITableView (<UITableView: 0x7fbc3a0cf600; frame = (0 154; 414 1000); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x7fbc38d27490>; layer = <CALayer: 0x7fbc38dc8450>; contentOffset: {0, 0}; contentSize: {414, 4400}>) failed to obtain a cell from its dataSource (<DataListViewController: 0x7fbc38c80f30>)'

经过解决,发现在tableView cellForRowAtIndexPath的方法中添加一句话问题就可以解决(添加图中注释的语句).

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
    
   UITableViewCell *ncell = [tableView dequeueReusableCellWithIdentifier:identifierdata];
    
//    if(ncell == nil){
//        
//ncell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifierdata];
//    
//    }

转载请注明出处.

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 173,441评论 25 708
  • 概述在iOS开发中UITableView可以说是使用最广泛的控件,我们平时使用的软件中到处都可以看到它的影子,类似...
    liudhkk阅读 9,091评论 3 38
  • 前言 由于最近两个多月,笔者正和小伙伴们忙于对公司新项目的开发,笔者主要负责项目整体架构的搭建以及功能模块的分工。...
    CoderMikeHe阅读 27,155评论 74 270
  • 首先抄一段解释说明。。。消息队列中间件是分布式系统中重要的组件,主要解决应用耦合,异步消息,流量削锋等问题,实现高...
    C_A_dogN阅读 378评论 0 0
  • 天不荒,地不老,岁月长又长。我们年轻时憧憬的美好会在我们合适的年龄实现吗。 25岁到35岁,我们年轻有活力...
    王豆豆爱吃糖阅读 278评论 0 0