Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/24.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone Can';似乎无法摆脱键值编码兼容错误_Iphone_Objective C_Xcode - Fatal编程技术网

Iphone Can';似乎无法摆脱键值编码兼容错误

Iphone Can';似乎无法摆脱键值编码兼容错误,iphone,objective-c,xcode,Iphone,Objective C,Xcode,这是我尝试在我的应用程序中以模式显示视图控制器时遇到的错误: *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<KVPasscodeViewController 0x8b815a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key instructio

这是我尝试在我的应用程序中以模式显示视图控制器时遇到的错误:

*** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<KVPasscodeViewController 0x8b815a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key instructionLabel.'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x011185a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x0126c313 objc_exception_throw + 44
    2   CoreFoundation                      0x011184e1 -[NSException raise] + 17
    3   Foundation                          0x00aea677 _NSSetUsingKeyValueSetter + 135
    4   Foundation                          0x00aea5e5 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 285
    5   UIKit                               0x0056630c -[UIRuntimeOutletConnection connect] + 112
    6   CoreFoundation                      0x0108e8cf -[NSArray makeObjectsPerformSelector:] + 239
    7   UIKit                               0x00564d23 -[UINib instantiateWithOwner:options:] + 1041
    8   UIKit                               0x00566ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
    9   UIKit                               0x0041c628 -[UIViewController _loadViewFromNibNamed:bundle:] + 70
    10  UIKit                               0x0041a134 -[UIViewController loadView] + 120
    11  UIKit                               0x0041a00e -[UIViewController view] + 56
    12  UIKit                               0x00418482 -[UIViewController contentScrollView] + 42
    13  UIKit                               0x00428f25 -[UINavigationController _computeAndApplyScrollContentInsetDeltaForViewController:] + 48
    14  UIKit                               0x00427555 -[UINavigationController _layoutViewController:] + 43
    15  UIKit                               0x00428870 -[UINavigationController _startTransition:fromViewController:toViewController:] + 524
    16  UIKit                               0x0042332a -[UINavigationController _startDeferredTransitionIfNeeded] + 266
    17  UIKit                               0x0053e2e9 -[UILayoutContainerView layoutSubviews] + 226
    18  QuartzCore                          0x002a6a5a -[CALayer layoutSublayers] + 181
    19  QuartzCore                          0x002a8ddc CALayerLayoutIfNeeded + 220
    20  QuartzCore                          0x002a8ed0 -[CALayer layoutIfNeeded] + 111
    21  UIKit                               0x0041b58a -[UIViewController window:willAnimateRotationToInterfaceOrientation:duration:] + 587
    22  UIKit                               0x0039255f -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 4347
    23  UIKit                               0x00619619 -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:] + 1381
    24  UIKit                               0x0041e65d -[UIViewController presentModalViewController:withTransition:] + 3478
    25  DearMe                              0x00011ca1 -[NotificationViewController addPasscode] + 273
    26  UIKit                               0x0036a4fd -[UIApplication sendAction:to:from:forEvent:] + 119
    27  UIKit                               0x003fa799 -[UIControl sendAction:to:forEvent:] + 67
    28  UIKit                               0x003fcc2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
    29  UIKit                               0x003fb7d8 -[UIControl touchesEnded:withEvent:] + 458
    30  UIKit                               0x0038eded -[UIWindow _sendTouchesForEvent:] + 567
    31  UIKit                               0x0036fc37 -[UIApplication sendEvent:] + 447
    32  UIKit                               0x00374f2e _UIApplicationHandleEvent + 7576
    33  GraphicsServices                    0x015f2992 PurpleEventCallback + 1550
    34  CoreFoundation                      0x010f9944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    35  CoreFoundation                      0x01059cf7 __CFRunLoopDoSource1 + 215
    36  CoreFoundation                      0x01056f83 __CFRunLoopRun + 979
    37  CoreFoundation                      0x01056840 CFRunLoopRunSpecific + 208
    38  CoreFoundation                      0x01056761 CFRunLoopRunInMode + 97
    39  GraphicsServices                    0x015f11c4 GSEventRunModal + 217
    40  GraphicsServices                    0x015f1289 GSEventRun + 115
    41  UIKit                               0x00378c93 UIApplicationMain + 1160
    42  DearMe                              0x000029df main + 127
    43  DearMe                              0x00002955 start + 53
    44  ???                                 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'

这是因为您有一个出口指向该视图控制器的XIB中的“instructionLabel”。

您有一个
.XIB
文件,该文件很可能指向不存在的标签。如果在Interface Builder中添加
UILabel
,将其附加到存在
instructionLabel
的代码中,然后从代码中删除
instructionLabel
,但忘记更新
.xib

,则通常会发生这种情况,但是我删除了它-它不再使用.xib文件了。但它似乎认为确实如此。我做了一个清理,但这并没有停止问题。你能添加你用来显示VC的代码吗?跟踪正在加载NIB.KVPasscodeViewController*passcodeController=[[KVPasscodeViewController alloc]init];这不是一个有效的交易。如果您试图不从NIB加载,请在VC中重写loadView。
KVPasscodeViewController *passcodeController = [[KVPasscodeViewController alloc] init];
    passcodeController.delegate = self;
    UINavigationController *passcodeNavigationController = [[UINavigationController alloc] initWithRootViewController:passcodeController];
    [self.navigationController presentModalViewController:passcodeNavigationController animated:YES];
    [passcodeNavigationController release];
    [passcodeController release];