今天在cell重用的时候出现一下错误

reason:  'unable  to  dequeue  a  cell  with  identifier  Cell  -  must  register  a  nib  or  a  class  for  the  identifier  or  connect  a  prototype  cell  in  a  storyboard';

最后发现

(1)UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]这个方法有问题换成

(2)UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 问题解决;

看错误提示第一个方法须在storyboard或xib中初始化的时候使用或者自定义cell时,需要如下两个方法

  1. - (void)registerNib:(UINib *)nib forCellReuseIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(5_0); 
  1. - (void)registerClass:(Class)cellClass forCellReuseIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(6_0);
例如
  1. [self.tableView registerClass:[MyTableviewCell class] forCellReuseIdentifier:@"MyCell"];
 

reason: 'unable to dequeue a cell with identifier Cell的更多相关文章

  1. UITableView错误 ‘unable to dequeue a cell with identifier Cell'

    - (id)dequeueReusableCellWithIdentifier:(NSString *)identifier; - (id)dequeueReusableCellWithIdentif ...

  2. unable to dequeue a cell with identifier MealTableViewCell

    1 问题描述 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable ...

  3. swift写一个简单的列表unable to dequeue a cell with identifier reuseIdentifier - must register a nib or a cla

    报错:unable to dequeue a cell with identifier reuseIdentifier - must register a nib or a class for the ...

  4. IOS-static cell 与 dynamic cell 混合使用

    static cell 与 dynamic cell 混合使用 关于静态cell与动态cell的混合使用,google一下便会有很多相关文章,这里也是看过一些前辈的经验(已经忘记具体是从哪篇文章得到的 ...

  5. 实现点击cell实现改变cell和cell上控件的背景颜色

    话不多少,贴上代码吧!!! // // ViewController.m // CellChangeBgColorDemo // // Created by 思 彭 on 17/1/12. // Co ...

  6. IOS第八天(7:UITableViewController新浪微博,cell 复用的简单写法优化和cell高度从模型中获取)

    *********** #import "HMViewController.h" #import "HMStatus.h" #import "HMSt ...

  7. iOS Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to

    刚接触iOS,依照教程操作执行出现错误 Terminating app due to uncaught exception 'NSInternalInconsistencyException', re ...

  8. tableview的两个重用cell方法

    今天在学习IAP的时候无意间看到原来  tableView: cellForRowAtIndexPath:方法中有两个获得重用cell的方法,一直以来都是用 UITableViewCell  *cel ...

  9. AJ学IOS(17)UI之纯代码自定义Cell实现新浪微博UI

    AJ分享,必须精品 先看效果图 编程思路 代码创建Cell的步骤 1> 创建自定义Cell,继承自UITableViewCell 2> 根据需求,确定控件,并定义属性 3> 用get ...

随机推荐

  1. Java学习之equals和hashcode的关系

    两个对象值相同(x.equals(y) == true),但却可有不同的hash code,这句话对不对? 答:不对,如果两个对象x和y满足x.equals(y) == true,它们的哈希码(has ...

  2. Could not load type System.ServiceModel.Activation.HttpModule解决办法

    等注册完成后网站就可以打开了. win2008下提示未能从程序集“System.ServiceModel, Version=3.0.0.0问题解决 在Windows Server 2008中的IIS服 ...

  3. A Byte of Python 笔记(5)函数:定义、形参、局部变量、默认参数、关键参数

    第7章  函数 函数是重要的程序段.它们允许你给一块语句一个名称,然后你可以在程序的任何地方使用这个名称任意多次地运行这个语句块.这被称为 调用 函数. 定义函数 函数通过 def 关键字定义.def ...

  4. WEB和APP谁是互联网未来

    据中国多家权威报告显示,作为多年专业化互联网公司炎帝网络科技综合评估预测,预计2016年全球互联网设备将达到100亿部.如果届时全球人口达到73亿,意味着平均每人将有1.4部设备.智能交通将增长50倍 ...

  5. 宣布正式发布 Windows Azure 上的 Oracle 软件以及 Windows Azure Traffic Manager 更新

     Windows Azure 的核心原则之一就是为客户提供一个开放.灵活的平台.今天是一个令人振奋的里程碑,因为我们与 Oracle 的合作又向前迈进了一步.Oracle Database.Ora ...

  6. C# Windows Sockets (Winsock) 接口 (转)

    在.Net中,System.Net.Sockets 命名空间为需要严密控制网络访问的开发人员提供了 Windows Sockets (Winsock) 接口的托管实现.System.Net 命名空间中 ...

  7. java线程学习——汉堡销售问题

    汉堡店中有一个负责做汉堡的厨师,一个负责销售的营业员,用java线程表示他们的营业过程: 问题原型就是生产者与消费者的问题. 首先定义一个汉堡包箱子类与几个相关的变量类: public class H ...

  8. /export/App/zz/phantomjs-1.9.7-linux-x86_64/bin

    /export/App/zz/phantomjs-1.9.7-linux-x86_64/bin

  9. 概率图模型(PGM)学习笔记(三)模式判断与概率图流

    我们依旧使用"学生网络"作为样例,如图1. 图1 首先给出因果判断(Causal Reasoning)的直觉解释. 能够算出来 即学生获得好的推荐信的概率大约是0.5. 但假设我们 ...

  10. [cocos2dx笔记011]使用Cocostudio UI编辑器

    本文地址:http://www.cppblog.com/zdhsoft/archive/2014/07/19/207715.html 笔记汇总:http://www.cppblog.com/zdhso ...