XCode 7 iOS 9产生'线程1:信号SIGABRT' main.m

时间:2015-12-16 19:35:18

标签: ios nsunknownkeyexception

当我运行我的应用程序时,它会生成Thread 1:signal SIGBART错误消息,其中包含以下详细信息:

TappingGame[767:9324] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x7fe5d0f12130> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key tapButton.'
*** First throw call stack:
 (
0   CoreFoundation                      0x000000010b07ee65 __exceptionPreprocess + 165
1   libobjc.A.dylib                     0x000000010aaf7deb objc_exception_throw + 48
2   CoreFoundation                      0x000000010b07eaa9 -[NSException raise] + 9
3   Foundation                          0x000000010a6c49bb -[NSObject(NSKeyValueCoding) setValue:forKey:] + 288
4   UIKit                               0x000000010b5ba320 -[UIViewController setValue:forKey:] + 88
5   UIKit                               0x000000010b7e8f41 -[UIRuntimeOutletConnection connect] + 109
6   CoreFoundation                      0x000000010afbf4a0 -[NSArray makeObjectsPerformSelector:] + 224
7   UIKit                               0x000000010b7e7924 -[UINib instantiateWithOwner:options:] + 1864
8   UIKit                               0x000000010b5c0eea -[UIViewController _loadViewFromNibNamed:bundle:] + 381
9   UIKit                               0x000000010b5c1816 -[UIViewController loadView] + 178
10  UIKit                               0x000000010b5c1b74 -[UIViewController loadViewIfRequired] + 138
11  UIKit                               0x000000010b5c22e7 -[UIViewController view] + 27
12  UIKit                               0x000000010b498ab0 -[UIWindow addRootViewControllerViewIfPossible] + 61
13  UIKit                               0x000000010b499199 -[UIWindow _setHidden:forced:] + 282
14  UIKit                               0x000000010b4aac2e -[UIWindow makeKeyAndVisible] + 42
15  UIKit                               0x000000010b423663 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4131
16  UIKit                               0x000000010b429cc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760
17  UIKit                               0x000000010b426e7b -[UIApplication workspaceDidEndTransaction:] + 188
18  FrontBoardServices                  0x000000010ddf7754 -[FBSSerialQueue _performNext] + 192
19  FrontBoardServices                  0x000000010ddf7ac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
20  CoreFoundation                      0x000000010afaaa31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
21  CoreFoundation                      0x000000010afa095c __CFRunLoopDoSources0 + 556
22  CoreFoundation                      0x000000010af9fe13 __CFRunLoopRun + 867
23  CoreFoundation                      0x000000010af9f828 CFRunLoopRunSpecific + 488
24  UIKit                               0x000000010b4267cd -[UIApplication _run] + 402
25  UIKit                               0x000000010b42b610 UIApplicationMain + 171
26  TappingGame                         0x000000010a5f89ef main + 111
27  libdyld.dylib                       0x000000010d7ba92d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

我已经查看了其他问题,但这些解决方案都没有奏效。有没有人从列出的错误中了解它为什么不起作用?

由于

2 个答案:

答案 0 :(得分:1)

错误中描述的问题是由于故事板或笔尖中的链接类不正确。

答案 1 :(得分:1)

您的链接不正确。您可能删除或更改了名称。

检查您的IBOutlet是否为图片正确的链接:

link

并删除无效链接。

invalid link