应用程序在runTransitionForCurrentState上崩溃,但不知道为什么 [英] App crashing on runTransitionForCurrentState but no clue as to why
问题描述
我已经尝试过搜索,但是没有运气,所以希望有一些大师可能知道答案.
I've tried searching for this, but no luck, so hoping there are some guru's who may know the answer.
我在我的应用程序的iTunes Connect中看到大量报告因特定的堆栈跟踪而崩溃,但是堆栈跟踪没有显示任何有用的信息.
I'm seeing loads of reports in iTunes Connect of my app crashing with a particular stack trace, but the stack trace reveals nothing useful.
#0. Crashed: main
0 UIKit 0x1871100c0 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 324
1 UIKit 0x1871100bc __56-[UIPresentationController runTransitionForCurrentState]_block_invoke + 320
2 UIKit 0x1870630c8 _runAfterCACommitDeferredBlocks + 292
3 UIKit 0x187070a80 _cleanUpAfterCAFlushAndRunDeferredBlocks + 92
4 UIKit 0x186da25a4 _afterCACommitHandler + 96
5 CoreFoundation 0x181c0c728 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
6 CoreFoundation 0x181c0a4cc __CFRunLoopDoObservers + 372
7 CoreFoundation 0x181c0a8fc __CFRunLoopRun + 928
8 CoreFoundation 0x181b34c50 CFRunLoopRunSpecific + 384
9 GraphicsServices 0x18341c088 GSEventRunModal + 180
10 UIKit 0x186e1a088 UIApplicationMain + 204
11 MyApp 0x100082e6c main (main.m:19)
12 libdyld.dylib 0x1816d28b8 start + 4
在iOS 9.1、9.2、9.3-10以及各种iPhone和iPad上都没有这些报告的模式,也没有任何线索可以帮助重现它们.
No pattern to the reports, happens on iOS 9.1, 9.2, 9.3-10 and various iPhones and iPads and no clues to help reproduce it.
任何人以前都经历过这样的事情,并且对可能导致它的原因有一些见识/怀疑吗?
Has anyone experienced something like this before and have some insight/suspicion on what may cause it?
推荐答案
我遇到了完全相同的崩溃,并且找出了原因.我的代码的简化版本看起来像
I have the exact same crash, and I've figured out the cause. A highly-reduced version of my code looks something like
[self dismissViewControllerAnimated:YES completion:nil];
// call a method that ends up doing
[appRootViewController dismissViewControllerAnimated:NO completion:nil];
上面片段中的
self
是一个视图控制器,已在根目录上以模态形式显示.视图控制器本身也已在当前上下文中模态地呈现了其他控制器.因此,我要做的是尝试通过动画关闭该过电流上下文控制器,然后调用其他代码,最终从没有动画的根目录中删除所有显示的视图控制器.
self
in the above snippet is a view controller that's been presented modally over the root. The view controller itself has also presented modally over current context some other controller. So what I'm doing is trying to dismiss that over-current-context controller with animation, then calling other code that ultimately dismisses any presented view controller from the root without animation.
或者换一种说法,在我上次开始进行动画解雇时,为我刚刚开始的动画解雇提供当前上下文的视图控制器将从视图层次结构中删除.
Or to put it another way, the view controller providing the current context for an animated dismiss that I just kicked off gets removed from the view hierarchy while the previous animated dismissal is in progress.
在Xcode中重现此内容时,还将以下内容记录到控制台:
When reproducing this in Xcode, it also logs the following to the console:
transitionViewForCurrentTransition未设置,演示过程中演示控制器被关闭了吗? (< _UIOverCurrentContextPresentationController:0x7faf277d9c30>)
transitionViewForCurrentTransition is not set, presentation controller was dismissed during the presentation? (<_UIOverCurrentContextPresentationController: 0x7faf277d9c30>)
这篇关于应用程序在runTransitionForCurrentState上崩溃,但不知道为什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!