0

我创建了一个文本字段和一个按钮来获取文本字段中的值并乘以 5。使用模拟器时,我收到此错误。我还看到 AppDelegate.swift 文件错误。请帮帮我,我在这里很沮丧,很烦人。

2017-08-10 23:57:49.999 test[82097:4630005] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<test.ViewController 0x7fca87e052d0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key calculateButtonClicked.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010f320b0b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010c6b0141 objc_exception_throw + 48
    2   CoreFoundation                      0x000000010f320a59 -[NSException raise] + 9
    3   Foundation                          0x000000010c1c600b -[NSObject(NSKeyValueCoding) setValue:forKey:] + 292
    4   UIKit                               0x000000010cd1d994 -[UIViewController setValue:forKey:] + 87
    5   UIKit                               0x000000010cf8aa09 -[UIRuntimeOutletConnection connect] + 109
    6   CoreFoundation                      0x000000010f2c6e8d -[NSArray makeObjectsPerformSelector:] + 269
    7   UIKit                               0x000000010cf893bf -[UINib instantiateWithOwner:options:] + 1856
    8   UIKit                               0x000000010cd23fc3 -[UIViewController _loadViewFromNibNamed:bundle:] + 381
    9   UIKit                               0x000000010cd248d9 -[UIViewController loadView] + 177
    10  UIKit                               0x000000010cd24c0a -[UIViewController loadViewIfRequired] + 195
    11  UIKit                               0x000000010cd2545a -[UIViewController view] + 27
    12  UIKit                               0x000000010cbed98a -[UIWindow addRootViewControllerViewIfPossible] + 65
    13  UIKit                               0x000000010cbee070 -[UIWindow _setHidden:forced:] + 294
    14  UIKit                               0x000000010cc00ebe -[UIWindow makeKeyAndVisible] + 42
    15  UIKit                               0x000000010cb7a37f -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4346
    16  UIKit                               0x000000010cb805e4 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1709
    17  UIKit                               0x000000010cb7d7f3 -[UIApplication workspaceDidEndTransaction:] + 182
    18  FrontBoardServices                  0x0000000110a305f6 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
    19  FrontBoardServices                  0x0000000110a3046d -[FBSSerialQueue _performNext] + 186
    20  FrontBoardServices                  0x0000000110a307f6 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
    21  CoreFoundation                      0x000000010f2c6c01 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    22  CoreFoundation                      0x000000010f2ac0cf __CFRunLoopDoSources0 + 527
    23  CoreFoundation                      0x000000010f2ab5ff __CFRunLoopRun + 911
    24  CoreFoundation                      0x000000010f2ab016 CFRunLoopRunSpecific + 406
    25  UIKit                               0x000000010cb7c08f -[UIApplication _run] + 468
    26  UIKit                               0x000000010cb82134 UIApplicationMain + 159
    27  test                                0x000000010c0d8977 main + 55
    28  libdyld.dylib                       0x00000001102c065d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
4

0 回答 0