码迷,mamicode.com
首页 > 其他好文 > 详细

TableView报错 failed to obtain a cell from its dataSource

时间:2017-03-08 15:33:03      阅读:191      评论:0      收藏:0      [点我收藏+]

标签:failed   color   ring   style   str   xpath   nsstring   string   原因   

检查原因1:是否已经注册cell

    [self.tableView registerNib:[UINib nibWithNibName:NSStringFromClass([SendTeachNotiTableViewCell class]) bundle:nil] forCellReuseIdentifier:@"teachersend"];

 

检查原因2:cellForRowAtIndexPath 方法中cell是否为空  可能cell调用早了,导致cell为nil时无法赋值

if(cell==nil)
{
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifierdata]

  }

TableView报错 failed to obtain a cell from its dataSource

标签:failed   color   ring   style   str   xpath   nsstring   string   原因   

原文地址:http://www.cnblogs.com/justqi/p/6519657.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!