iphone - Objective-C : uncaught exception 'NSUnknownKeyException'

标签 iphone objective-c ios xcode ipad

<分区>

我在这条线上有这个错误“Thread 1: Program received signal: 'SIGABRT'”...

[window addSubview:viewController.view];

这是什么意思??

错误信息如下:

2011-11-10 10:01:08.334 Paint Brush[1624:207] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<Paint_BrushViewController 0x4b1b1d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key clear.'
*** Call stack at first throw:
(

    0   CoreFoundation                      0x00dc25a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x00f16313 objc_exception_throw + 44
    2   CoreFoundation                      0x00dc24e1 -[NSException raise] + 17
    3   Foundation                          0x00794677 _NSSetUsingKeyValueSetter + 135
    4   Foundation                          0x007945e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
    5   UIKit                               0x0021030c -[UIRuntimeOutletConnection connect] + 112
    6   CoreFoundation                      0x00d388cf -[NSArray makeObjectsPerformSelector:] + 239
    7   UIKit                               0x0020ed23 -[UINib instantiateWithOwner:options:] + 1041
    8   UIKit                               0x00210ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
    9   UIKit                               0x000c6628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
    10  UIKit                               0x000c4134 -[UIViewController loadView] + 120
    11  UIKit                               0x000c400e -[UIViewController view] + 56
    12  Paint Brush                         0x000024ae -[Paint_BrushAppDelegate application:didFinishLaunchingWithOptions:] + 94
    13  UIKit                               0x00014c89 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1163
    14  UIKit                               0x00016d88 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 439
    15  UIKit                               0x00021617 -[UIApplication handleEvent:withNewEvent:] + 1533
    16  UIKit                               0x00019abf -[UIApplication sendEvent:] + 71
    17  UIKit                               0x0001ef2e _UIApplicationHandleEvent + 7576
    18  GraphicsServices                    0x00ffb992 PurpleEventCallback + 1550
    19  CoreFoundation                      0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    20  CoreFoundation                      0x00d03cf7 __CFRunLoopDoSource1 + 215
    21  CoreFoundation                      0x00d00f83 __CFRunLoopRun + 979
    22  CoreFoundation                      0x00d00840 CFRunLoopRunSpecific + 208
    23  CoreFoundation                      0x00d00761 CFRunLoopRunInMode + 97
    24  UIKit                               0x000167d2 -[UIApplication _run] + 623
    25  UIKit                               0x00022c93 UIApplicationMain + 1160
    26  Paint Brush                         0x00002419 main + 121
    27  Paint Brush                         0x00002395 start + 53
)

terminate called after throwing an instance of 'NSException'

最佳答案

在这个 Paint_BrushAppDelegate 类中,您可能会设置一个键,该键可能不是正确的 NSString。请检查您作为键传递的语法或对象。请检查它是否不为零。

关于iphone - Objective-C : uncaught exception 'NSUnknownKeyException' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8074289/

相关文章:

objective-c - CoreGraphics 随机崩溃

ios - 未知属性属性 'atomic'

php - 如何在 PHP 中安全地返回文件数据

ios - 该团队已经达到了 iPhone 设备的最大数量

ios - 使用 native iOS 相机应用拍摄的照片始终为 UIImageOrientationUp

objective-c - Demux HLS TS流从视频拆分音频AAC

ios - CALayer - CABasicAnimation 不围绕中心/ anchor 缩放

iphone - iTunesArtwork 和 XCode

iphone - IOS 中 glColor4f OpenGl 函数的应用程序崩溃

ios - NSUserDefaults 突然停止保存数据