首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >libc++abi.dylib:使用类型NSException (lldb)的未捕获异常终止

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

Stack Overflow用户
提问于 2014-10-19 01:11:36
回答 22查看 384.6K关注 0票数 193

我在swift中编写了一个应用程序,当我在iPhone模拟器上运行测试应用程序时,一切都正常,但随后我尝试向右滑动,这是我添加的一个手势,让它转到下一个页面(视图控制器2),它崩溃了,并在控制台日志中显示此错误报告。

2014-10-18 12:07:34.400 soundtest[17081:818922] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<soundtest.ViewControllerTwo 0x7f92f1f20090> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key sfdfa.'
*** First throw call stack:
(
    0   CoreFoundation                      0x00000001067813f5 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001082afbb7 objc_exception_throw + 45
    2   CoreFoundation                      0x0000000106781039 -[NSException raise] + 9
    3   Foundation                          0x0000000106b984d3 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
    4   CoreFoundation                      0x00000001066cb400 -[NSArray makeObjectsPerformSelector:] + 224
    5   UIKit                               0x00000001072ce97d -[UINib instantiateWithOwner:options:] + 1506
    6   UIKit                               0x000000010712f698 -[UIViewController _loadViewFromNibNamed:bundle:] + 242
    7   UIKit                               0x000000010712fc88 -[UIViewController loadView] + 109
    8   UIKit                               0x000000010712fef9 -[UIViewController loadViewIfRequired] + 75
    9   UIKit                               0x000000010713038e -[UIViewController view] + 27
    10  UIKit                               0x00000001076cd83f -[_UIFullscreenPresentationController _setPresentedViewController:] + 65
    11  UIKit                               0x000000010710bc49 -[UIPresentationController initWithPresentedViewController:presentingViewController:] + 105
    12  UIKit                               0x000000010713c121 -[UIViewController _presentViewController:withAnimationController:completion:] + 1746
    13  UIKit                               0x000000010713e461 __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 132
    14  UIKit                               0x000000010713e385 -[UIViewController presentViewController:animated:completion:] + 229
    15  UIKit                               0x00000001073bb9d6 _UIGestureRecognizerSendActions + 262
    16  UIKit                               0x00000001073ba679 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 532
    17  UIKit                               0x00000001073bf296 ___UIGestureRecognizerUpdate_block_invoke662 + 51
    18  UIKit                               0x00000001073bf192 _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 254
    19  UIKit                               0x00000001073b520d _UIGestureRecognizerUpdate + 2796
    20  UIKit                               0x00000001070520a6 -[UIWindow _sendGesturesForEvent:] + 1041
    21  UIKit                               0x0000000107052cd3 -[UIWindow sendEvent:] + 667
    22  UIKit                               0x000000010701fae1 -[UIApplication sendEvent:] + 246
    23  UIKit                               0x000000010702cbad _UIApplicationHandleEventFromQueueEvent + 17370
    24  UIKit                               0x0000000107008233 _UIApplicationHandleEventQueue + 1961
    25  CoreFoundation                      0x00000001066b6ad1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
    26  CoreFoundation                      0x00000001066ac99d __CFRunLoopDoSources0 + 269
    27  CoreFoundation                      0x00000001066abfd4 __CFRunLoopRun + 868
    28  CoreFoundation                      0x00000001066aba06 CFRunLoopRunSpecific + 470
    29  GraphicsServices                    0x000000010a1699f0 GSEventRunModal + 161
    30  UIKit                               0x000000010700b550 UIApplicationMain + 1282
    31  soundtest                           0x000000010624503e top_level_code + 78
    32  soundtest                           0x000000010624507a main + 42
    33  libdyld.dylib                       0x000000010ae4a145 start + 1
    34  ???                                 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 
EN

回答 22

Stack Overflow用户

回答已采纳

发布于 2014-12-10 05:59:15

如果你把一个按钮连接到一个不再存在的IBAction上(或者已经被重命名了),他的问题也可能发生。

如果您遇到此问题,请确保您转到Main.storyboard,右键单击电话轮廓顶部的黄色框图标(查看控制器),然后删除带有黄色标志的插座。

在这种情况下会发生的情况是,您可能命名了一个操作,然后将其重命名。您需要删除旧名称,如果这是唯一的问题将开始在sim!

票数 408
EN

Stack Overflow用户

发布于 2018-06-16 23:12:51

您是否碰巧设置了OS_ACTIVITY_MODE变量?要检查是否设置了此变量(并将其关闭),请在Xcode 9中执行以下操作:

Select from Xcode menu Product -> Scheme -> Edit Scheme.. Select the Run scheme and look under Arguments. If you see the OS_ACTIVITY_MODE variable checked, deselect it

票数 95
EN

Stack Overflow用户

发布于 2015-05-18 11:15:20

它也可能是错误的Segue Identifier名称。例如-

performSegueWithIdentifier("wrongSegueName", sender: self)
票数 6
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26442414

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档