gpt4 book ai didi

ios - UIPresentationController 崩溃只是指向 AppDelegate

转载 作者:搜寻专家 更新时间:2023-10-31 22:10:12 30 4
gpt4 key购买 nike

截图:

enter image description here


enter image description here 我遇到了很多这样的崩溃,但问题是我只是被指向我的 appDelegate 第一行。我不知道在哪里寻找问题。我可以从以下崩溃报告开始调查的任何想法?

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

更新:

基于以下内容:

App crashing on runTransitionForCurrentState but no clue as to why

我正在寻找潜在原因,并对以下代码感到疑惑。

在执行同步过程时,我有以下功能用于呈现带有事件指示器的 View 。

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)
}

然后我像这样使用这个函数:

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 问题的潜在原因吗?

最佳答案

按照以下步骤,你可以做到:1.打开导航器;2.切换到BreakPoint Navigator;3、点击左下方的“+”按钮;4. 弹出时点击“Exception BreakPoint”。

然后再次运行你的项目,它会在确切的点中断。

关于ios - UIPresentationController 崩溃只是指向 AppDelegate,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48764872/

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