Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x19862

并且xcode代码运行到UIApplicationDelegate的 [self.windowmakeKeyAndVisible];时停止,提示program received signal “SIGABRT”

今天打开工程后就出现了标题的崩溃,原来的工程我改过xib所以就提示一些错误,原来是我改了之后没有关联写方法,删除后就好了

这个问题的root cause是在xib中某个控件已经通过outlet连接到ViewController中的某个变量上了,后来变量删除了,但是这种连接关系没有删除,导致启动时找不到对应的key,抛出上述exception。

解决办法如下:

找到该controller对应的xib,右键查看某个控件关联的属性 是否已经不存在:

如下图:

看看对应的属性 是否在ViewController。h 中 还存在,如不存在点击上图中的 红色线 上的 差号,删除关联,然后重新拉线。

图1:配置Custom Class

图2:配置View Controller

参考:http://blog.csdn.net/h3c4lenovo/article/details/8556887

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x19862

时间: 2024-11-06 06:05:06

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x19862的相关文章

*** Terminating app due to uncaught exception &#39;NSUnknownKeyException&#39;, reason: &#39;[&lt;DataModel 0x7fe44b

self.model=[[DataModel alloc]init]; [self.model setValue:@"searph" forKey:@"stockName"]; [self.model setValue:@"10.0" forKey:@"price"]; [self.model addObserver:self forKeyPath:@"price" options:NSKeyValueOb

*** Terminating app due to uncaught exception &#39;NSUnknownKeyException&#39;, reason: &#39;[ViewController &gt; setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key backBtn.' 第一种情况:xib文件属性输出口连接错误,IBout多连或者忘关输入口 第二种情况:引入第三方的SDK会出现错误,

Terminating app due to uncaught exception &#39;NSUnknownKeyException&#39; this class is not key value coding-compliant for the key

 Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ViewController > setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key backBtn.' 第一种情况:xib文件属性输出口连接错误,IBout多连或者忘关输入口 第二种情况:引入第三方的SDK会出现错误,导入的

Terminating app due to uncaught exception &#39;NSUnknownKeyException&#39;, reason: xxxx

出现错误的情景: 使用Swift自定义Cell, 然后将这个Cell在OC中使用, 由于为了能够在OC中使用和使用起来命名比较规范 我在Swift自定义的Cell前加了 @objc(DSProductCell) 完整版是这样的: @objc(DSProductCell) class ProductCell: UITableViewCell {} 然后在xib上对cell进行搭建... 之后在OC使用的时候就出现了这个错误... 最后排查出现这个问题的原因: xib中的class没有加上前缀, 也

iOS Terminating app due to uncaught exception &amp;#39;NSInternalInconsistencyException&amp;#39;, reason: &amp;#39;unable to

刚接触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 解

Terminating app due to uncaught exception &#39;CALayerInvalidGeometry&#39;, reason: &#39;CALayer position contains NaN: [160 nan]解决方法

1 2014-06-11 15:19:17.167 ***[930:707] *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [160 nan]' 2 *** Call stack at first throw: 3 ( 4 0 CoreFoundation 0x3365d64f __exceptionPreprocess

Terminating app due to uncaught exception &#39;NSRangeException&#39;, reason: -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array&#39;

首页 > iOS问答 > 详情 *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 0 beyond bounds for empty array' *** First throw call stack: (0x1f9b012 0x1a90e7e 0x1f3d0b4 0x6baaf 0x1aa46b0 0x1c1bb

iOS Terminating app due to uncaught exception &#39;NSInternalInconsistencyException&#39;, reason: &#39;unable to

刚接触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 解

Terminating app due to uncaught

1>Images.xcassets: A [email protected] app icon is required for iPhone apps targeting iOS 7.0 and later 图片像素过低编译器警告 不影响使用 2>Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<DJMessage 0x7fe7a8dac5d0> setValue:forUnd