热门标签 | HotTags
当前位置:  开发笔记 > 前端 > 正文

[iOS13]:致命异常:NSInvalidArgumentException无法将自身添加为子视图([NSCacheinit])

如何解决《[iOS13]:致命异常:NSInvalidArgumentException无法将自身添加为子视图([NSCacheinit])》经验,是哪儿的问题?

我在Stack Overflow上看到过类似的问题,但它们并没有帮助。

我使用Xcode 11和iOS 13 SDK构建了该应用程序。问题是,即使我的应用程序支持iOS 10+,并且只有约50%的iOS 12用户,我都只能在iOS 13+上获得所有这些崩溃。另外,我无法调试或复制它。

从此信息中我推断出该问题必须特定于iOS13。最近有人遇到过同一问题吗?可能的原因,解决方法?

这是Crashlytics的堆栈跟踪:

Fatal Exception: NSInvalidArgumentException
0  CoreFoundation                 0x1c25e1c30 __exceptionPreprocess
1  libobjc.A.dylib                0x1c22fc0c8 objc_exception_throw
2  CoreFoundation                 0x1c24d13ac -[NSCache init]
3  UIKitCore                      0x1c6b189a8 -[UIView(Internal) _addSubview:positioned:relativeTo:]
4  UIKitCore                      0x1c6078bb4 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke_2
5  UIKitCore                      0x1c6b11f60 +[UIView(Animation) performWithoutAnimation:]
6  UIKitCore                      0x1c6078630 __53-[_UINavigationParallaxTransition animateTransition:]_block_invoke
7  UIKitCore                      0x1c6b1784c +[UIView(Internal) _performBlockDelayingTriggeringResponderEvents:forScene:]
8  UIKitCore                      0x1c6078088 -[_UINavigationParallaxTransition animateTransition:]
9  UIKitCore                      0x1c606e2b0 ___UIViewControllerTransitioningRunCustomTransition_block_invoke_2
10 UIKitCore                      0x1c61822f8 +[UIInputResponderController _pinInputViewsForInputResponderController:onBehalfOfResponder:duringBlock:]
11 UIKitCore                      0x1c606e238 ___UIViewControllerTransitioningRunCustomTransition_block_invoke.648
12 UIKitCore                      0x1c6b11c0c +[UIView(Animation) _setAlongsideAnimations:toRunByEndOfBlock:]
13 UIKitCore                      0x1c606e088 _UIViewControllerTransitioningRunCustomTransition
14 UIKitCore                      0x1c5f9d77c -[UINavigationController _startCustomTransition:]
15 UIKitCore                      0x1c5fb0c18 -[UINavigationController _startDeferredTransitionIfNeeded:]
16 UIKitCore                      0x1c5fb20f8 -[UINavigationController __viewWillLayoutSubviews]
17 UIKitCore                      0x1c5f954e0 -[UILayoutContainerView layoutSubviews]
18 UIKitCore                      0x1c6b1fabc -[UIView(CALayerDelegate) layoutSublayersOfLayer:]
19 libobjc.A.dylib                0x1c22f7af0 -[NSObject performSelector:withObject:]
20 QuartzCore                     0x1c90be0f4 -[CALayer layoutSublayers]
21 QuartzCore                     0x1c90be3fc CA::Layer::layout_if_needed(CA::Transaction*)
22 QuartzCore                     0x1c90d1964 CA::Layer::layout_and_display_if_needed(CA::Transaction*)
23 QuartzCore                     0x1c9016c1c CA::Context::commit_transaction(CA::Transaction*, double)
24 QuartzCore                     0x1c9041bd8 CA::Transaction::commit()
25 QuartzCore                     0x1c90427ac CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*)
26 CoreFoundation                 0x1c255c67c __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__
27 CoreFoundation                 0x1c255731c __CFRunLoopDoObservers
28 CoreFoundation                 0x1c25578cc __CFRunLoopRun
29 CoreFoundation                 0x1c2557098 CFRunLoopRunSpecific
30 GraphicsServices               0x1cc6c1534 GSEventRunModal
31 UIKitCore                      0x1c66777ac UIApplicationMain

更新1:该问题与所有运行iOS 13的iPhone有关,而不仅仅是iPhone X(S,R)系列。

更新2:该问题也与iOS 12有关,但是与iOS 13相比,崩溃很少发生。我的猜测是,该问题与使用iOS 13 SDK构建项目有关,因为使用iOS 12 SDK构建的相同代码没有不会发出此类崩溃信息,并且导航逻辑没有更新。


推荐阅读
author-avatar
Aovte
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有