gpt4 book ai didi

ios - 通过单击按钮切换 View Controller 会导致以 NSException 类型的未捕获异常终止

转载 作者:行者123 更新时间:2023-11-29 01:27:47 32 4
gpt4 key购买 nike

您好,我正在制作一个应用程序,想使用一个按钮从一个 View Controller 切换到另一个 View Controller 。我使用了模态转场并创建了一个调用 performSegueWithIdentifierUIbutton 操作。然而,我得到了

Terminating with uncaught exception of type NSException

AppleDelegate 文件中的错误。我不知道这里发生了什么。请帮我!多谢。以下是该程序的解释:

2015-11-20 01:22:21.575 Photo book[17126:547637] Unknown class ViewController1 in Interface Builder file.
2015-11-20 01:22:21.581 Photo book[17126:547637] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7f9698e1d2b0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Open.'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103d7fc65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000103a18bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000103d7f8a9 -[NSException raise] + 9
3 Foundation 0x00000001035aeb53 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 259
4 CoreFoundation 0x0000000103cc7d50 -[NSArray makeObjectsPerformSelector:] + 224
5 UIKit 0x000000010469252b -[UINib instantiateWithOwner:options:] + 1506
6 UIKit 0x00000001048f4aba -[UIStoryboard instantiateViewControllerWithIdentifier:] + 181
7 UIKit 0x00000001048f80bf -[UIStoryboardSegueTemplate _perform:] + 71
8 UIKit 0x0000000111251638 -[UIViewControllerAccessibility performSegueWithIdentifier:sender:] + 39
9 Photo book 0x0000000103479c66 _TFC10Photo_book14ViewController5LoginfS0_FCSo8UIButtonT_ + 278
10 Photo book 0x0000000103479cea _TToFC10Photo_book14ViewController5LoginfS0_FCSo8UIButtonT_ + 58
11 UIKit 0x00000001043bbda2 -[UIApplication sendAction:to:from:forEvent:] + 75
12 UIKit 0x00000001044cd54a -[UIControl _sendActionsForEvents:withEvent:] + 467
13 UIKit 0x00000001044cc919 -[UIControl touchesEnded:withEvent:] + 522
14 UIKit 0x0000000104408998 -[UIWindow _sendTouchesForEvent:] + 735
15 UIKit 0x00000001044092c2 -[UIWindow sendEvent:] + 682
16 UIKit 0x00000001043cf581 -[UIApplication sendEvent:] + 246
17 UIKit 0x00000001043dcd1c _UIApplicationHandleEventFromQueueEvent + 18265
18 UIKit 0x00000001043b75dc _UIApplicationHandleEventQueue + 2066
19 CoreFoundation 0x0000000103cb3431 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
20 CoreFoundation 0x0000000103ca92fd __CFRunLoopDoSources0 + 269
21 CoreFoundation 0x0000000103ca8934 __CFRunLoopRun + 868
22 CoreFoundation 0x0000000103ca8366 CFRunLoopRunSpecific + 470
23 GraphicsServices 0x00000001085cda3e GSEventRunModal + 161
24 UIKit 0x00000001043ba900 UIApplicationMain + 1282
25 Photo book 0x000000010348b1c7 main + 135
26 libdyld.dylib 0x0000000106965145 start + 1
27 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)

最佳答案

当您不小心从 .h 文件中删除了 iboutlet 但它们在您的 xib 或 Storyboard中仍然连接时会发生此错误。请确保您的所有 iboutlet 在您的第二个 View 中正确连接。

关于ios - 通过单击按钮切换 View Controller 会导致以 NSException 类型的未捕获异常终止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33820256/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com