问题描述
屏幕截图:
我遇到了很多此类崩溃,但问题是我只是被指向我的appDelegate第一行.我不知道在哪里寻找问题.您可以从以下崩溃报告中开始调查的任何想法吗?
I am getting a lot of these crashes but the problem is I'm just being pointed to my appDelegate first line. I've no idea where to look for the issue. Any ideas where I could start to investigate from the following crash report?
Crashed: com.apple.main-thread
0 UIKit 0x18d005640 __56-
[UIPresentationController runTransitionForCurrentState]_block_invoke + 460
1 UIKit 0x18cf27aa8 _runAfterCACommitDeferredBlocks + 292
2 UIKit 0x18cf1ae5c _cleanUpAfterCAFlushAndRunDeferredBlocks + 288
3 UIKit 0x18ccac464 _afterCACommitHandler + 132
4 CoreFoundation 0x1836a6cdc __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
5 CoreFoundation 0x1836a4694 __CFRunLoopDoObservers + 412
6 CoreFoundation 0x1836a4c50 __CFRunLoopRun + 1292
7 CoreFoundation 0x1835c4c58 CFRunLoopRunSpecific + 436
8 GraphicsServices 0x185470f84 GSEventRunModal + 100
9 UIKit 0x18cd1d5c4 UIApplicationMain + 236
10 AppName 0x100ae3ca4 main (AppDelegate.swift:23)
11 libdyld.dylib 0x1830e456c start + 4
更新:
基于以下内容:
应用程序在runTransitionForCurrentState上崩溃但没有任何线索为什么
我正在寻找潜在的原因,并且想知道以下代码.
I'm looking at potential causes and am wondering about the following code.
在执行同步过程时,我具有以下功能,可通过活动指示器显示视图.
I have the following func for presenting a view with an activity indicator while I am doing a sync process.
public func displayActivityAlertWithCompletion(_ title: String, ViewController: UIViewController, completionHandler: @escaping ()->())
{
let pending = UIAlertController(title: "\n\n\n"+title, message: nil, preferredStyle: .alert)
//create an activity indicator
let indicator = UIActivityIndicatorView(frame: pending.view.bounds)
indicator.autoresizingMask = [.flexibleWidth, .flexibleHeight]
indicator.color = UIColor(rgba: Palette.loadingColour)
//add the activity indicator as a subview of the alert controller's view
pending.view.addSubview(indicator)
indicator.isUserInteractionEnabled = false
// required otherwise if there buttons in the UIAlertController you will not be able to press them
indicator.startAnimating()
ViewController.present(pending, animated: true, completion: completionHandler)
}
然后我像这样使用这个函数:
I then use this func like so:
displayActivityAlertWithCompletion("Pushing Data", ViewController: self){_ in
Helper_class.doSync(_cleanSync: false){
//sync is complete
Prefs.is_Syncing = false
DispatchQueue.main.async {
//dismiss my view with activity alert
self.dismiss(animated: true){
//dismiss my viewcontroller
Toast(text: "Upload sync completed").show()
self.dismiss(animated: true, completion: nil)
}
}
}
}
这是否可能是导致UIKit问题的原因?
Would this be a potential cause for the UIKit issue?
推荐答案
按照以下步骤操作,您可以做到:1.打开导航器;2.切换到BreakPoint Navigator;3.单击左下方的"+"按钮;4.弹出时,单击异常断点".
Follow these steps, you can make it:1. Open Navigator;2. Switch to BreakPoint Navigator;3. Click the "+" button in the bottom left;4. When pop up, click "Exception BreakPoint".
然后再次运行您的项目,它将在确切的位置中断.
Then run your project again, it will break at the exact point.
这篇关于UIPresentationController崩溃只是指向AppDelegate的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!