这个类不符合键值编码的要求,无法使用 featured 键。

6

我怀疑有些代码试图将我的FooterArchiveView类似于NSDictionary使用,因此我尝试使用断点找到瓶颈,但我的断点却把我带入了系统文件,如UINibDecoderDecodeObjectForValue。我该怎么办?

2012-03-08 08:35:55.417 JOM App[44161:207] Uncaught exception: [<FooterArchiveView 0x9b27770> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key featured.
2012-03-08 08:35:55.420 JOM App[44161:207] Stack trace: (
    0   CoreFoundation                      0x0169c06e __exceptionPreprocess + 206
    1   libobjc.A.dylib                     0x01c50d0a objc_exception_throw + 44
    2   CoreFoundation                      0x0169bf11 -[NSException raise] + 17
    3   Foundation                          0x00f89032 -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
    4   Foundation                          0x00efaf7b _NSSetUsingKeyValueSetter + 136
    5   Foundation                          0x00efaeeb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 287
    6   UIKit                               0x00628268 -[UIView(CALayerDelegate) setValue:forKey:] + 168
    7   Foundation                          0x00f15d60 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 393
    8   UIKit                               0x0080891a -[UIRuntimeOutletConnection connect] + 106
    9   CoreFoundation                      0x0169de1a -[NSObject performSelector:] + 58
    10  CoreFoundation                      0x01607821 -[NSArray makeObjectsPerformSelector:] + 273
    11  UIKit                               0x0080746e -[UINib instantiateWithOwner:options:] + 1178
    12  UIKit                               0x00809010 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 157
    13  JOM App                             0x0000e9ca -[ContentView setContent:] + 1258
    14  JOM App                             0x0000c906 -[NavigationView devotionsTUI:] + 390
    15  CoreFoundation                      0x0169dec9 -[NSObject performSelector:withObject:withObject:] + 73
    16  UIKit                               0x005ec5c2 -[UIApplication sendAction:to:from:forEvent:] + 96
    17  UIKit                               0x005ec55a -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
    18  UIKit                               0x00691b76 -[UIControl sendAction:to:forEvent:] + 66
    19  UIKit                               0x0069203f -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 503
    20  UIKit                               0x006912fe -[UIControl touchesEnded:withEvent:] + 549
    21  UIKit                               0x00611a30 -[UIWindow _sendTouchesForEvent:] + 513
    22  UIKit                               0x00611c56 -[UIWindow sendEvent:] + 273
    23  UIKit                               0x005f8384 -[UIApplication sendEvent:] + 464
    24  UIKit                               0x005ebaa9 _UIApplicationHandleEvent + 8196
    25  GraphicsServices                    0x02589fa9 PurpleEventCallback + 1274
    26  CoreFoundation                      0x016701c5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    27  CoreFoundation                      0x015d5022 __CFRunLoopDoSource1 + 146
    28  CoreFoundation                      0x015d390a __CFRunLoopRun + 2218
    29  CoreFoundation                      0x015d2db4 CFRunLoopRunSpecific + 212
    30  CoreFoundation                      0x015d2ccb CFRunLoopRunInMode + 123
    31  GraphicsServices                    0x02588879 GSEventRunModal + 207
    32  GraphicsServices                    0x0258893e GSEventRun + 114
    33  UIKit                               0x005e9a9b UIApplicationMain + 1175
    34  JOM App                             0x000027d2 main + 178
    35  JOM App                             0x00002715 start + 53
    36  ???                                 0x00000001 0x0 + 1
)

2
我认为你的xib文件有一个额外的元素连接到了一个不存在的“featured”插座,或者反过来。无论如何,“featured”在这里是解决问题的“关键”。 - govi
1
错误可能是未定义的键。*setValue:forUndefinedKey:*。也许您拼写了属性名称。如果可能,请提供一些代码。没有代码可能很难修复。 - Lorenzo B
1个回答

23

"该类不符合关键值编码(compliant for the key)的要求,无法为特征(featured)设置属性。"意味着一个类试图通过关键值编码设置对象上的属性,但却发现它无法这样做。这通常发生在您定义了一个输出口(outlet),将其连接到nib文件中,然后从代码中删除了该输出口,留下了nib文件中的一条悬挂的连接。当nib文件被反序列化时,它会尝试使用关键值编码来连接输出口,并显示上述错误。


1
你救了我很多时间,Jim! - William T. Mallard

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接