сбой приложения iphone - PullRequest
       2

сбой приложения iphone

0 голосов
/ 03 февраля 2011

Я получаю ошибку при запуске приложения со следующим исключением.

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
    )

1 Ответ

5 голосов
/ 03 февраля 2011

Сообщение об ошибке: Завершение работы приложения из-за необработанного исключения «NSUnknownKeyException», причина: «[setValue: forUndefinedKey:]: этот класс не соответствует значению ключа для кода customCell. '

... означает, что ваша xib ссылается на IBOutlet с именем «customCell», но ваш контроллер представления больше не имеет этого IBOutlet. Вам нужно либо удалить ссылку customCell из вашей xib, либо добавить свойство IBOutlet в свой контроллер представления с именем «customCell».

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...