gpt4 book ai didi

ios - 更新 Xcode 14 后,我们遇到了应用程序绕过 对象的 Objective-C 运行时 dealloc 启动的错误

转载 作者:行者123 更新时间:2023-12-05 05:32:22 25 4
gpt4 key购买 nike

将 Xcode 更新到版本 14 后,我们在启动应用程序时遇到了崩溃。我们如何解决这个问题。

[13113:89575] *** Assertion failure in -[UIButton dealloc], UIView.m:4628

*** 由于未捕获的异常“NSInternalInconsistencyException”而终止应用程序,原因:“应用程序规避了对象的 Objective-C 运行时 dealloc 启动。”

*** First throw call stack:
(
0 CoreFoundation 0x00007ff800427378 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff80004dbaf objc_exception_throw + 48
2 Foundation 0x00007ff800b876ac _userInfoForFileAndLine + 0
3 UIKitCore 0x000000011eb8e997 -[UIView dealloc] + 1458
4 UIKitCore 0x000000011dcfb835 -[UIButton dealloc] + 41
5 libobjc.A.dylib 0x00007ff80004b6a1 _ZN11objc_object17sidetable_releaseEbb + 203
6 CoreFoundation 0x00007ff8003144e8 __RELEASE_OBJECTS_IN_THE_ARRAY__ + 11
7 CoreFoundation 0x00007ff80031442e -[__NSArrayM dealloc] + 283
8 libobjc.A.dylib 0x00007ff80004b6a1 _ZN11objc_object17sidetable_releaseEbb + 203
9 libobjc.A.dylib 0x00007ff80004be64 _ZN19AutoreleasePoolPage12releaseUntilEPP11objc_object + 18
10 libobjc.A.dylib 0x00007ff80004bcad objc_autoreleasePoolPop + 203
11 UIKitCore 0x000000011e0a083b -[UINib instantiateWithOwner:options:] + 3109
12 UIKitCore 0x000000011dcaad51 -[UIViewController loadView] + 640
13 UIKitCore 0x000000011dcab0a7 -[UIViewController loadViewIfRequired] + 95
14 UIKitCore 0x000000011dbd6d7e -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 162
15 UIKitCore 0x000000011dbd70c2 -[UINavigationController _startTransition:fromViewController:toViewController:] + 227
16 UIKitCore 0x000000011dbd80c3 -[UINavigationController _startDeferredTransitionIfNeeded:] + 863
17 UIKitCore 0x000000011dbd9468 -[UINavigationController __viewWillLayoutSubviews] + 136
18 UIKitCore 0x000000011dbb704c -[UILayoutContainerView layoutSubviews] + 207
19 UIKitCore 0x000000011ebc0913 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2305
20 QuartzCore 0x00007ff8088f8cb8 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 526
21 QuartzCore 0x00007ff808904191 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 65
22 QuartzCore 0x00007ff80881821d _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 623
23 QuartzCore 0x00007ff80884fa56 _ZN2CA11Transaction6commitEv + 714

24 UIKitCore 0x000000011e5b831c __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 34

25 CoreFoundation 0x00007ff800386cb1 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 12
26 CoreFoundation 0x00007ff80038646a __CFRunLoopDoBlocks + 406

27 CoreFoundation 0x00007ff800380dc8 __CFRunLoopRun + 948

28 CoreFoundation 0x00007ff800380637 CFRunLoopRunSpecific + 560

29 GraphicsServices 0x00007ff809c0f28a GSEventRunModal + 139

30 UIKitCore 0x000000011e598425 -[UIApplication _run] + 994

31 UIKitCore 0x000000011e59d301 UIApplicationMain + 123

32 UK News 0x00000001071675e9 main + 73

33 dyld 0x0000000108a142bf start_sim + 10

34 ??? 0x0000000109c6252e 0x0 + 4458947886

)

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Application circumvented Objective-C runtime dealloc initiation for <UIButton> object.'

CoreSimulator 857.7 - Device: iPhone 14 (722946E3-1DBE-4032-911B-51C89F27E522) - R

最佳答案

在您的项目中搜索初始化方法并将其替换为加载方法。在下面检查。

Find
+(void)initialize
{
[super initialize];
}

Replace
+(void)load
{
[super load];
}

关于ios - 更新 Xcode 14 后,我们遇到了应用程序绕过 <UIButton> 对象的 Objective-C 运行时 dealloc 启动的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/74155243/

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