libc ++ abi.dylib:以NSException类型的未捕获异常终止 - Xcode 8

时间:2016-11-04 07:57:05

标签: ios swift xcode

我正在使用故事板和xCode 8上的swift 3,我收到以下错误:

  

libc ++ abi.dylib:以NSException类型的未捕获异常终止   (lldb)

这是完整的错误日志:

    2016-11-03 17:49:13.614 SidebarMenu[14577:867114] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<SidebarMenu.PopOverViewController 0x7fe4aa0401c0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key btn3_leftTapped.'
*** First throw call stack:
(
    0   CoreFoundation                      0x000000010beda34b __exceptionPreprocess + 171
    1   libobjc.A.dylib                     0x000000010b93b21e objc_exception_throw + 48
    2   CoreFoundation                      0x000000010beda299 -[NSException raise] + 9
    3   Foundation                          0x000000010b44b2ff -[NSObject(NSKeyValueCoding) setValue:forKey:] + 291
    4   UIKit                               0x000000010cba78c3 -[UIViewController setValue:forKey:] + 88
    5   UIKit                               0x000000010ce1bbe6 -[UIRuntimeOutletConnection connect] + 109
    6   CoreFoundation                      0x000000010be7f590 -[NSArray makeObjectsPerformSelector:] + 256
    7   UIKit                               0x000000010ce1a56a -[UINib instantiateWithOwner:options:] + 1867
    8   UIKit                               0x000000010cbadff5 -[UIViewController _loadViewFromNibNamed:bundle:] + 386
    9   UIKit                               0x000000010cbae917 -[UIViewController loadView] + 177
    10  UIKit                               0x000000010cbaec4c -[UIViewController loadViewIfRequired] + 201
    11  UIKit                               0x000000010cbaf4a0 -[UIViewController view] + 27
    12  UIKit                               0x000000010cbfd3ba -[UINavigationController preferredContentSize] + 198
    13  UIKit                               0x000000010d4ff0a1 -[UIPopoverPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 152
    14  UIKit                               0x000000010cb8d5bc __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 111
    15  UIKit                               0x000000010ca1a8bb _runAfterCACommitDeferredBlocks + 320
    16  UIKit                               0x000000010ca0753f _cleanUpAfterCAFlushAndRunDeferredBlocks + 566
    17  UIKit                               0x000000010ca387ce _afterCACommitHandler + 176
    18  CoreFoundation                      0x000000010be7ee17 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
    19  CoreFoundation                      0x000000010be7ed87 __CFRunLoopDoObservers + 391
    20  CoreFoundation                      0x000000010be63b9e __CFRunLoopRun + 1198
    21  CoreFoundation                      0x000000010be63494 CFRunLoopRunSpecific + 420
    22  GraphicsServices                    0x00000001115b2a6f GSEventRunModal + 161
    23  UIKit                               0x000000010ca0df34 UIApplicationMain + 159
    24  SidebarMenu                         0x000000010af53b5f main + 111
    25  libdyld.dylib                       0x0000000112e2968d start + 1
    26  ???                                 0x0000000000000001 0x0 + 1
)

错误消息的第一行告诉我错误位于PopOverViewController而不是btn3_leftTapped。 在PopOverViewController中,我已经从按钮连接了一个Action:

@IBAction func btn3_leftTappedNow(_ sender: AnyObject) {
}
@IBAction func btn3_rightTapped(_ sender: AnyObject) {
    self.dismiss(animated: true){ () -> Void in

        NotificationCenter.default.post(name: NSNotification.Name(rawValue: btn3_rightTappedDone), object: nil, userInfo: nil)

    }
}

首先我认为我必须删除此连接,然后重新创建它,但它不会改变。即使我删除了连接并使用不同的名称创建了一个新的连接,例如btn3_leftTappedNow,我仍然会收到上面显示的错误消息。 我使用ctrl + f在短语之后搜索我的.swift文件,但它不再在我的文档中了。

我试过了产品 - &gt;干净,但我仍然得到错误,我没有建立应用程序的问题。

我该怎么做才能解决这个错误?

0 个答案:

没有答案