2010-11-21 37 views
0

你能帮我,我的应用程序运行良好,但是当我做了一个修改,(我不记得是什么样的修改)我得到这个消息控制台:终止抛出'NSException'错误的实例后调用

[Session started at 2010-11-21 17:15:36 -0500.] 
2010-11-21 17:15:37.472 ITMFR[3942:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UICustomObject 0x6a50d90> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key window.' 
*** Call stack at first throw: 
(
0 CoreFoundation      0x021f2b99 __exceptionPreprocess + 185 
1 libobjc.A.dylib      0x0234240e objc_exception_throw + 47 
2 CoreFoundation      0x021f2ad1 -[NSException raise] + 17 
3 Foundation       0x000320f3 _NSSetUsingKeyValueSetter + 135 
4 Foundation       0x00032061 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285 
5 UIKit        0x004b070a -[UIRuntimeOutletConnection connect] + 112 
6 CoreFoundation      0x02168d0f -[NSArray makeObjectsPerformSelector:] + 239 
7 UIKit        0x004af121 -[UINib instantiateWithOwner:options:] + 1041 
8 UIKit        0x004b0eb5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168 
9 UIKit        0x002bc402 -[UIApplication _loadMainNibFile] + 172 
10 UIKit        0x002bd31c -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198 
11 UIKit        0x002c73ec -[UIApplication handleEvent:withNewEvent:] + 1958 
12 UIKit        0x002bfb3c -[UIApplication sendEvent:] + 71 
13 UIKit        0x002c49bf _UIApplicationHandleEvent + 7672 
14 GraphicsServices     0x02ad2822 PurpleEventCallback + 1550 
15 CoreFoundation      0x021d3ff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 
16 CoreFoundation      0x02134807 __CFRunLoopDoSource1 + 215 
17 CoreFoundation      0x02131a93 __CFRunLoopRun + 979 
18 CoreFoundation      0x02131350 CFRunLoopRunSpecific + 208 
19 CoreFoundation      0x02131271 CFRunLoopRunInMode + 97 
20 UIKit        0x002bcc6d -[UIApplication _run] + 625 
21 UIKit        0x002c8af2 UIApplicationMain + 1160 
22 ITMFR        0x00003eb8 main + 102 
23 ITMFR        0x000028e9 start + 53 
24 ???         0x00000001 0x0 + 1 

) 抛出的 'NSException'

请帮我一个实例后终止叫!

+0

这是如何使用版本控制系统非常有用的一个很好的例子! – Chetan 2010-11-21 22:34:00

回答

1

从崩溃报告中,我猜想您所做的更改是针对界面构建器中的nib/xib文件,特别是将值绑定到按钮/控件。检查Inspector的所有UI控件以确保绑定到共享用户默认值控制器的任何Button绑定具有控制器密钥values,而不是别的。

+0

感谢您的快速回复,但您可以在哪里看到? – Charles 2010-11-21 22:43:52

+0

从下往上看,你可以看到它试图加载主要的笔尖。它试图建立与IBOutlet的连接并为与插座相关的密钥设置一个值 - 将接口中的某些内容绑定到代码中的某些内容。它失败并崩溃。 Chetan的回答在逻辑上来自这一系列事件。没有保证,但看起来很可能。 – 2010-11-21 22:52:52

+0

但是你可以看到什么是绑定?我没有在按钮的检查器中看到它。 – Charles 2010-11-21 22:56:54

0

这发生在我身上,因为我忘了@synthesize。

@synthesize window; 

在我的视图控制器。

相关问题