刚接触iOS,依照教程操作执行出现错误

Terminating app due to uncaught exception 'NSInternalInconsistencyException', 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

解决的方法是加一句:

[self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier];

加的位置是:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 



    static NSString *CellIdentifier = @"ListPrototypeCell"; 

    [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:CellIdentifier]; 

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 



    // config cell

 XYZToDoItem * toDoItem = [self.toDoItem objectAtIndex:indexPath.row];

cell.textLabel.text = toDoItem.itemName;

return cell; 

}

因为刚学习IOS,原因不明

iOS Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to的更多相关文章

  1. Terminating app due to uncaught exception 'NSUnknownKeyException' this class is not key value coding-compliant for the key

     Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > se ...

  2. *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key

    *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > ...

  3. 在使用可变数组过程中遇到*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'问题

    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[__NSCFD ...

  4. Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'

    报错: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlace ...

  5. *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<_UIFeedbackParameters 0x1d4442e50> setNilValueForKey]: could not set nil as the value for the key rate.'

    *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '[<_UIFeedbac ...

  6. iOS程序崩溃*** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [37.5 nan]'

    今天上班打开昨天的程序运行,昨天跑的很溜的程序今天竟然crash了,好郁闷啊!下面附上crash的栈打印信息: 经过一番调试终于找到了原因,程序crash是因为CALayer的位置中含有不存在的数,就 ...

  7. Terminating app due to uncaught exception 'CALayerInvalid', reason: 'layer <CALayer: 0x7fda42c66e30> is a part of cycle in its layer tree'

    iOS App里面所有的View构成一个组件树,这个树里面如果有了闭环就会出现这个报错,最常见的你不小在某UIViewController里面写了这样的代码: someView.addSubView( ...

  8. *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<WKWebViewConfiguration 0x1701bcd20> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the k

    问题描述: ionic项目,windows下正常,打包android可正常运行: 因为需要打包到iPhone (ios 11.0.1)上测试,将代码拿到Mac OS环境下(重新npm install. ...

  9. Adding an Exception Breakpoint - Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 25 bey

    用如下的方法可以非常方便停留到具体crash的某行代码 Adding an Exception Breakpoint Add an exception breakpoint to your proje ...

随机推荐

  1. Python操作MongoDB(PyMongo模块的使用)

    #!/usr/bin/env python #coding:utf-8 # Author:   --<qingfengkuyu> # Purpose: MongoDB的使用 # Creat ...

  2. C语言代码复习笔记:第二章

    输出星星 #include <stdio.h> void printStart( int num ) { ) { printf("*"); }; } int main( ...

  3. Skyline开发3-没有注册类0x80040154

    原生64位程序 我们现在使用的操作系统多为64位系统,其中大部分用的还是32位的软件. 64位软件优点是:可以进行更大范围的整数运算:可以支持更大的内存:除做科学运算的时候取得更好的性能外,不能提高其 ...

  4. 为什么选择SpringBoot

    JavaEE仅仅使用Spring逐渐变得笨重起来,大量的XML文件存在与项目中,繁琐的配置,整合第三方框架的配置问题,低下的开发效率和部署效率等等问题. Spring Boot解决的问题 (1) Sp ...

  5. android中使用WebView请求本地网页

    使用WebView的方式请参考我的上一篇文章:android中使用WebView请求网页 这里说一下请求本地网页的方法: 本地网页应该把网页保存在src/main/assets目录下: webView ...

  6. SpringBoot报错 : Whitelabel Error Page

    添加了一个Controller类,本来想试下Spring MVC是否可以正常运行,结果报错,Controller类的内容: @RestController public class Test1Cont ...

  7. Maven教程初级篇02:pom.xml配置初步

    1. 创建项目并更改项目基本配置信息 在命令行下运行如下命令创建一个项目: 1 mvn archetype:create -DgroupId=net.jianxi.tutorials     2    ...

  8. javascript将算法复杂度从O(n^2)做到O(n)

    compare the difference of two giving array, return results: 1. elements in both array, 2. elements o ...

  9. Git客户端安装

    Git介绍 分布式 : Git版本控制系统是一个分布式的系统, 是用来保存工程源代码历史状态的命令行工具; 保存点 : Git的保存点可以追踪源码中的文件, 并能得到某一个时间点上的整个工程项目额状态 ...

  10. linux下查看和修改文件时间

    一.查看文件时间及相关命令 1.stat查看文件时间 [root@web10 ~]# stat install.log File: "install.log" Size: 3338 ...