今天在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时,需要如下两个方法

- (void)registerNib:(UINib *)nib forCellReuseIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(5_0); 
- (void)registerClass:(Class)cellClass forCellReuseIdentifier:(NSString *)identifier NS_AVAILABLE_IOS(6_0);
例如
[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. JavaSE_ 多线程 总目录(23~24)

    JavaSE学习总结第23天_多线程123.01 多线程程序的引入23.02 进程概述及多进程的意义23.03 线程概述及多线程的意义23.04 并行和并发的区别23.05 Java程序运行原理和JV ...

  2. Windows+Apache+PHP5配置

    今天配置Windows+Apache+PHP时,遇到的问题,记录下供大家参考,也供自己以后参考!需要特别注意的:PHP v9版本的 非线程安全的 只适用于IIS,5.3版本的NTS版的没有php5ap ...

  3. synchronized和vilatile

    第一个程序 public class Test06 implements Runnable{ public int a = 0; public static void main(String[] ar ...

  4. 《刺杀金正恩》1080p全高清无水印,附中文字幕 bt种子下载,附字母(百度网盘/360云盘)

    <刺杀金正恩>1080p全高清无水印,附中文字幕下载(百度网盘/360云盘) 种子和字幕下载地址: thunder://QUFlZDJrOi8vfGZpbGV8JUU5JTg3JTg3JU ...

  5. HDU 2393 Higher Math

    #include <cstdio> #include <string> using namespace std; void swap(int& a,int& b ...

  6. dojo 学习笔记

    1  因为Dijit包括了一系列的UI组件,他绑定了4个支持的主题:nihilo, soria, tundra 和claro.每个主题包括了一系列的图片和CSS文件来控制组件的外观.CSS文件必须显示 ...

  7. TCP编程的一个小例子

    TCP程序的服务器端与客户端的流程图 例子:服务器端等待客户端连接,若连接成功,则用户可以通过客户端向服务器端发送任意字符串,服务器端在收到字符串后,输出相关信息,在把接受到的字符串重新发生给客户端. ...

  8. IT 名企招聘信息

    [搜狗]网页搜索抓取与挖掘组诚聘实习生 工作方向: 抓取架构方向. 职位要求  1.对互联网和搜索引擎技术有浓厚兴趣: 2.熟练使用c .熟悉Linux开发环境.熟悉shell.python.awk等 ...

  9. Qt编写文件一键命名软件

    之所以会写这篇博文,主要是由于近期从网上下载了一堆图片,但图片名称非常没有规律,处理起来非常不方便,由此想到是不是有一键命名的软件能够帮助我对全部图片命名,是图片名称有规律,这样在处理时方便操作. 有 ...

  10. ExtJs 4 的filefield上传后 返回值success接受不正常

    问题解决了,我修改了返回类型为setContentType("text/html")可以正确解析了,感到很奇怪,其他的地方使用setContentType("applic ...