刚接触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. Skyline开发4-IProject接口

    IProject接口可以访问工程设置和打开保存工程的基本方法. 属性 FileVersion:返回 ITEVersionInfo.表示当前运行的TerraExplorer的版本,可通过ITEVersi ...

  2. Mycat读写分离、主从切换学习(转)

    http://blog.csdn.net/zhanglei_16/article/details/50707487 Mycat读写分离.主从切换学习问题一:分表.分库的优缺点,以及分表无法成为主流分表 ...

  3. Socket 编程IO Multiplexing

     Linux Socket 编程中I/O Multiplexing 主要通过三个函数来实现:select, poll,epoll来实现.I/O Multiplexing,先构造一张有关描述符的列表,然 ...

  4. javascript 和 jquery插件开发

    window.onload 页面加载完成后执行 window.onload = function () { function dom(id) { return document.getElementB ...

  5. JMeter运行通过Chrome打开的website

    部分website在chrome上运行正常,但在IE环境运行会存在问题.而是用 JMeter运行通过chrome打开的website时候,需要处理一下. 可以参考下面几篇文章: http://ninj ...

  6. mysql版本导致的hibernate 方言问题

    今天在看hibernate视频时,看到视频上人家的hibernate.cfg.xml配置文件在配置hibernate方言时,发现视频上是这样写的<property name="dial ...

  7. web.xml关于spring的讲解

    <context-param>的作用: web.xml的配置中<context-param>配置作用 . 启动一个WEB项目的时候,容器(如:Tomcat)会去读它的配置文件w ...

  8. 来自Unix/Linux的编程启发录

    本篇文章已授权微信公众号 guolin_blog (郭霖)独家公布重点内容 2017年第一篇文章,祝各位好友新年快乐. 年前因为不小心坐到了自己左手大拇指导致轻微的骨裂,没有按时更新,实在是羞愧.今年 ...

  9. Java的一个关于“星球”的枚举

    public enum Planet { /** * 水星 */ MERCURY(3.302e+23, 2.439e6), /** * 金星 */ VENUS(4.869e+24, 6.052e6), ...

  10. soapui configure before taking to develop code

    1,first go to the settings and configure as below: