本文介绍了Xcode错误 - 终止应用程序由于未捕获异常“NSUnknownKeyException”,原因:'[setValue:forUndefinedKey:]:的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道哪里可能有问题:/

i dont know where can be problem:/

2014-04-11 22:36:33.815 bus[1432:60b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<TableViewCell 0x8e63160> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key DescriptionLablel.'
*** First throw call stack:
(
    0   CoreFoundation                      0x017ee1e4 __exceptionPreprocess + 180
    1   libobjc.A.dylib                     0x0156d8e5 objc_exception_throw + 44
    2   CoreFoundation                      0x0187dfe1 -[NSException raise] + 17
    3   Foundation                          0x0122dd9e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
    4   Foundation                          0x0119a1d7 _NSSetUsingKeyValueSetter + 88
    5   Foundation                          0x01199731 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
    6   UIKit                               0x0029c508 -[UIView(CALayerDelegate) setValue:forKey:] + 168
    7   Foundation                          0x011fbb0a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
    8   UIKit                               0x004e41f4 -[UIRuntimeOutletConnection connect] + 106
    9   libobjc.A.dylib                     0x0157f7de -[NSObject performSelector:] + 62
    10  CoreFoundation                      0x017e976a -[NSArray makeObjectsPerformSelector:] + 314
    11  UIKit                               0x004e2d4d -[UINib instantiateWithOwner:options:] + 1417
    12  UIKit                               0x00319db0 -[UITableView _dequeueReusableViewOfType:withIdentifier:] + 370
    13  UIKit                               0x0031a089 -[UITableView dequeueReusableCellWithIdentifier:] + 48
    14  UIKit                               0x0031a0b9 -[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] + 43
    15  bus                                 0x000034bf -[TableViewController tableView:cellForRowAtIndexPath:] + 127
    16  UIKit                               0x0032611f -[UITableView _createPreparedCellForGlobalRow:withIndexPath:] + 412
    17  UIKit                               0x003261f3 -[UITableView _createPreparedCellForGlobalRow:] + 69
    18  UIKit                               0x00307ece -[UITableView _updateVisibleCellsNow:] + 2428
    19  UIKit                               0x0031c6a5 -[UITableView layoutSubviews] + 213
    20  UIKit                               0x0029c964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
    21  libobjc.A.dylib                     0x0157f82b -[NSObject performSelector:withObject:] + 70
    22  QuartzCore                          0x03c5945a -[CALayer layoutSublayers] + 148
    23  QuartzCore                          0x03c4d244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
    24  QuartzCore                          0x03c593a5 -[CALayer layoutIfNeeded] + 160
    25  UIKit                               0x0035eae3 -[UIViewController window:setupWithInterfaceOrientation:] + 304
    26  UIKit                               0x00274aa7 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:isRotating:] + 5212
    27  UIKit                               0x00273646 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 82
    28  UIKit                               0x00273518 -[UIWindow _setRotatableViewOrientation:updateStatusBar:duration:force:] + 117
    29  UIKit                               0x002735a0 -[UIWindow _setRotatableViewOrientation:duration:force:] + 67
    30  UIKit                               0x0027263a __57-[UIWindow _updateToInterfaceOrientation:duration:force:]_block_invoke + 120
    31  UIKit                               0x0027259c -[UIWindow _updateToInterfaceOrientation:duration:force:] + 400
    32  UIKit                               0x002732f3 -[UIWindow setAutorotates:forceUpdateInterfaceOrientation:] + 870
    33  UIKit                               0x002768e6 -[UIWindow setDelegate:] + 449
    34  UIKit                               0x00350b77 -[UIViewController _tryBecomeRootViewControllerInWindow:] + 180
    35  UIKit                               0x0026c474 -[UIWindow addRootViewControllerViewIfPossible] + 591
    36  UIKit                               0x0026c5ef -[UIWindow _setHidden:forced:] + 312
    37  UIKit                               0x0026c86b -[UIWindow _orderFrontWithoutMakingKey] + 49
    38  UIKit                               0x002773c8 -[UIWindow makeKeyAndVisible] + 65
    39  UIKit                               0x00227bc0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 2097
    40  UIKit                               0x0022c667 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
    41  UIKit                               0x00240f92 -[UIApplication handleEvent:withNewEvent:] + 3517
    42  UIKit                               0x00241555 -[UIApplication sendEvent:] + 85
    43  UIKit                               0x0022e250 _UIApplicationHandleEvent + 683
    44  GraphicsServices                    0x037e3f02 _PurpleEventCallback + 776
    45  GraphicsServices                    0x037e3a0d PurpleEventCallback + 46
    46  CoreFoundation                      0x01769ca5 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
    47  CoreFoundation                      0x017699db __CFRunLoopDoSource1 + 523
    48  CoreFoundation                      0x0179468c __CFRunLoopRun + 2156
    49  CoreFoundation                      0x017939d3 CFRunLoopRunSpecific + 467
    50  CoreFoundation                      0x017937eb CFRunLoopRunInMode + 123
    51  UIKit                               0x0022bd9c -[UIApplication _run] + 840
    52  UIKit                               0x0022df9b UIApplicationMain + 1225
    53  bus                                 0x00003a4d main + 141
    54  libdyld.dylib                       0x01e35701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)


推荐答案

这意味着在nib文件中有一个名为 DescriptionLablel 的出口,但是你的代码中没有属性。 Label拼写错误,因此可能是您的问题。

It means that in a nib file you have an outlet called DescriptionLablel, but you don't have a property for it in your code. "Label" is misspelled, so that could be your problem.

这篇关于Xcode错误 - 终止应用程序由于未捕获异常“NSUnknownKeyException”,原因:'[setValue:forUndefinedKey:]:的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-14 13:37