iPhone应用程序崩溃

vad*_*elu -2 iphone tableview

运行应用程序时出现以下异常时出错.

Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<FavoriteViewController 0x158d30> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key customCell.'
    *** Call stack at first throw:
    (
        0   CoreFoundation                      0x314d0987 __exceptionPreprocess + 114
        1   libobjc.A.dylib                     0x319a149d objc_exception_throw + 24
        2   CoreFoundation                      0x314d0705 -[NSException dealloc] + 0
        3   Foundation                          0x31d28b4f -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 182
        4   Foundation                          0x31d2803b _NSSetUsingKeyValueSetter + 90
        5   Foundation                          0x31d29da3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 194
        6   Foundation                          0x31cdbb17 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 130
        7   UIKit                               0x33a8860f -[UIRuntimeOutletConnection connect] + 66
        8   CoreFoundation                      0x31473fc7 -[NSObject(NSObject) performSelector:] + 18
        9   CoreFoundation                      0x3147cd51 -[NSArray makeObjectsPerformSelector:] + 388
        10  UIKit                               0x33a87577 -[UINib instantiateWithOwner:options:] + 586
        11  UIKit                               0x33a88b39 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 92
        12  Fridge                              0x0001ab11 -[FavoriteViewController tableView:cellForRowAtIndexPath:] + 192
        13  UIKit                               0x33907a21 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 516
        14  UIKit                               0x339077f3 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 34
        15  UIKit                               0x33905d2d -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 936
        16  UIKit                               0x33904edd -[UITableView layoutSubviews] + 140
        17  UIKit                               0x338b10cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
        18  CoreFoundation                      0x3146ebbf -[NSObject(NSObject) performSelector:withObject:] + 22
        19  QuartzCore                          0x30a6c685 -[CALayer layoutSublayers] + 120
        20  QuartzCore                          0x30a6c43d CALayerLayoutIfNeeded + 184
        21  QuartzCore                          0x30a6656d _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 212
        22  QuartzCore                          0x30a66383 _ZN2CA11Transaction6commitEv + 190
        23  QuartzCore                          0x30a89f9d _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 52
        24  CoreFoundation                      0x31460c59 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16
        25  CoreFoundation                      0x31460acd __CFRunLoopDoObservers + 412
        26  CoreFoundation                      0x314580cb __CFRunLoopRun + 854
        27  CoreFoundation                      0x31457c87 CFRunLoopRunSpecific + 230
        28  CoreFoundation                      0x31457b8f CFRunLoopRunInMode + 58
        29  GraphicsServices                    0x35d664ab GSEventRunModal + 114
        30  GraphicsServices                    0x35d66557 GSEventRun + 62
        31  UIKit                               0x338d5329 -[UIApplication _run] + 412
        32  UIKit                               0x338d2e93 UIApplicationMain + 670
        33  Fridge                              0x00002d77 main + 70
        34  Fridge                              0x00002d2c start + 40
    )
Run Code Online (Sandbox Code Playgroud)

Ken*_*and 5

错误消息:由于未捕获的异常'NSUnknownKeyException'终止应用程序,原因:'[setValue:forUndefinedKey:]:此类不是密钥customCell的密钥值编码兼容.

...表示您的xib引用名为"customCell"的IBOutlet,但您的视图控制器不再具有该IBOutlet.您需要从xib中删除customCell引用,或者将IBOutlet属性添加到名为"customCell"的视图控制器中.