gpt4 book ai didi

ios - Storyboard触发器 Segue 上的未捕获错误

转载 作者:行者123 更新时间:2023-11-29 02:18:00 26 4
gpt4 key购买 nike

我正在使用 Storyboards,当我触发 segue 时,我收到一些错误:未捕获的异常:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason:      '[<CommercerApp.ProductDetailController 0x78ff1030> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key contentView.'
*** First throw call stack:
(
0 CoreFoundation 0x00c9f946 _exceptionPreprocess + 182
1 libobjc.A.dylib 0x00928a97 objc_exception_throw + 44
2 CoreFoundation 0x00c9f561 -[NSException raise] + 17
3 Foundation 0x005b010e -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x0050c138 _NSSetUsingKeyValueSetter + 115
5 Foundation 0x0050c0bd -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x005419a6 -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 386
7 UIKit 0x01639649 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x0093e724 -[NSObject performSelector:] + 62
9 CoreFoundation 0x00bd95dc -[NSArray makeObjectsPerformSelector:] + 316
10 UIKit 0x0163810a -[UINib instantiateWithOwner:options:] + 1775
11 UIKit 0x0145a624 -[UIViewController _loadViewFromNibNamed:bundle:] + 270
12 UIKit 0x0145adbb -[UIViewController loadView] + 295
13 UIKit 0x0145afef -[UIViewController loadViewIfRequired] + 78
14 UIKit 0x0145b595 -[UIViewController view] + 35
15 UIKit 0x0149c534 -[UINavigationController preferredContentSize] + 161
16 UIKit 0x0143644d -[UIPresentationController preferredContentSizeDidChangeForChildContentContainer:] + 122
17 UIKit 0x01433922 _56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 156
18 UIKit 0x014677ab _40+[UIViewController _scheduleTransition:]_block_invoke + 18
19 UIKit 0x0132d0ce __afterCACommitHandler_block_invoke + 15
20 UIKit 0x0132d079 _applyBlockToCFArrayCopiedToStack + 415
21 UIKit 0x0132ce8e _afterCACommitHandler + 545
22 CoreFoundation 0x00bc29de _CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
23 CoreFoundation 0x00bc2920 _CFRunLoopDoObservers + 400
24 CoreFoundation 0x00bb835a _CFRunLoopRun + 1226
25 CoreFoundation 0x00bb7bcb CFRunLoopRunSpecific + 443
26 CoreFoundation 0x00bb79fb CFRunLoopRunInMode + 123
27 GraphicsServices 0x0526024f GSEventRunModal + 192
28 GraphicsServices 0x0526008c GSEventRun + 104
29 UIKit 0x013038b6 UIApplicationMain + 1526
30 CommercerApp 0x0012dbce top_level_code + 78
31 CommercerApp 0x0012dc0b main + 43
32 libdyld.dylib 0x02b24ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

我的 Storyboard是这样的:(当我从左到右打开第4-->第5个segue时出现异常) Storyboard

如果您有任何想法,请帮我解决。

最佳答案

错误确实说明了问题,你只需要仔细阅读即可:

Terminating app due to uncaught exception 'NSUnknownKeyException', reason:      '[<CommercerApp.ProductDetailController 0x78ff1030> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key contentView.'

让我为您重点介绍一下:

reason: '[<CommercerApp.ProductDetailController 0x78ff1030> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key contentView.'

这意味着类试图通过键值编码为对象设置属性,但失败了。如果您定义 IBOutlet ,则可能会发生这种情况并将其连接到 Storyboard中;然后稍后删除代码中的 socket 并导致 Storyboard 具有悬空连接。在这种情况下, buggy 似乎在 ProductDetailController 中。 ,您应该返回那里并检查您所做的更改,而无需相应地更新您的 Storyboard。

关于ios - Storyboard触发器 Segue 上的未捕获错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28522015/

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