关于错误 reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'

来源:互联网 发布:深圳软件产业基地招聘 编辑:程序博客网 时间:2024/06/01 09:01


reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'



今天运行的时候  直接就报错  程序运行不出来     


错误就是    reason: 'UITableView dataSource must return a cell from tableView:cellForRowAtIndexPath:'


这个你初看可能是觉得没有传递有效的cell到单元格中


所以我进行了断点调试   发现我的模型中有数据  可是传不到我自定义的cell中


最后发现是我的自定义cell  的   Identfier  这个属性没有设置


所以只要你把这个属性设置成你 准备重用单元格的标记  就行了   


如图   我的cell  ID 是  app_cell   加上之后  成功运行   






0 0