在更新Xcode 14之后,我们面临着应用程序绕过Objective-C运行时为对象解除分配初始化的错误< UIButton>

pgx2nnw8  于 2022-12-14  发布在  其他
关注(0)|答案(1)|浏览(807)

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

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

***由于未捕获的异常“NSInternalInconsistencyException”,正在终止应用程序,原因:'应用程序绕过了对象Objective-C运行时取消分配初始化'

*** 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
nafvub8i

nafvub8i1#

在项目中搜索initialise方法并将其替换为load方法。请在下面检查。

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

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

相关问题