gpt4 book ai didi

ios - 了解 Crashlytics 崩溃报告(部分适用)

转载 作者:行者123 更新时间:2023-12-03 15:54:58 27 4
gpt4 key购买 nike

无法理解 Crashlytics 中的崩溃报告。我在分析崩溃报告方面没有太多经验。感谢你的帮助。

这是崩溃日志:

Crashed: com.apple.main-thread
0 My App 0x100f77180 specialized closure #1 in closure #1 in ConfirmItemCheckInViewController.doneButtonPressed() (ConfirmItemCheckInViewController.swift:175)
1 My App 0x100f77c94 partial apply for closure #1 in closure #1 in ConfirmItemCheckInViewController.doneButtonPressed() (ConfirmItemCheckInViewController.swift)
2 My App 0x100f95650 thunk for @callee_owned (@owned UIAlertAction) -> () (SettingsViewController.swift)
3 UIKit 0x18e4f5cf4 -[UIAlertController _invokeHandlersForAction:] + 108
4 UIKit 0x18e4f66ec __103-[UIAlertController _dismissAnimated:triggeringAction:triggeredByPopoverDimmingView:dismissCompletion:]_block_invoke.459 + 28
5 UIKit 0x18e33b030 -[UIPresentationController transitionDidFinish:] + 1320
6 UIKit 0x18e33ea20 __56-[UIPresentationController runTransitionForCurrentState]_block_invoke_2 + 188
7 UIKit 0x18e10a9d8 -[_UIViewControllerTransitionContext completeTransition:] + 116
8 UIKit 0x18e02fd7c -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 764
9 UIKit 0x18e02f70c -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 312
10 UIKit 0x18e02f418 -[UIViewAnimationState animationDidStop:finished:] + 296
11 UIKit 0x18e02f4b8 -[UIViewAnimationState animationDidStop:finished:] + 456
12 QuartzCore 0x188bd3d6c CA::Layer::run_animation_callbacks(void*) + 284
13 libdispatch.dylib 0x18456d048 _dispatch_client_callout + 16
14 libdispatch.dylib 0x184579b74 _dispatch_main_queue_callback_4CF$VARIANT$mp + 1016
15 CoreFoundation 0x184b8ff20 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 12
16 CoreFoundation 0x184b8dafc __CFRunLoopRun + 2012
17 CoreFoundation 0x184aae2d8 CFRunLoopRunSpecific + 436
18 GraphicsServices 0x18693ff84 GSEventRunModal + 100
19 UIKit 0x18e05b880 UIApplicationMain + 208
20 My App 0x100f4f924 main (AppDelegate.swift:15)
21 libdyld.dylib 0x1845d256c start + 4

更新:添加了 doneButtonPressed 的代码。
我最近没有对这部分做任何更改。该场景自发布以来1.5年没有发生任何崩溃。
 func doneButtonPressed() {
if let signImage = signatureImage {
if let scheduleID = scheduleID {
if let driverID = driverID {
if let customerID = customerID {
let progressHUD = MBProgressHUD.showAdded(to: self.view, animated: true)
progressHUD.label.text = "Checking Item In"
NetworkLoader.sharedLoader.confirmCheckIn(signImage, shipmentID: scheduleID, customerID: customerID, driverID: driverID, items: items, valueAddedItems: self.valueAddedItemsList, completion: { (networkStatus, status) in
progressHUD.hide(animated: true)
if status {
// Remove saved signature
var index = SignatureData.sharedSignatureData.getSignatureIndex(scheduleID)
if index != -1 {
SignatureData.sharedSignatureData.sharedSignatureItems.remove(at: index)
}
// Remove saved item
index = PickupItemData.sharedPickupItemData.getPickupItemIndex(scheduleID)
if index != -1 {
PickupItemData.sharedPickupItemData.sharedPickupItems.remove(at: index)
}

let alert = UIAlertController(title: "Checked In", message: "", preferredStyle: UIAlertControllerStyle.alert)
let alertAction: UIAlertAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: { (_) in
let myScheduleNC :UINavigationController = self.storyboard?.instantiateViewController(withIdentifier: "MyScheduleNavController") as! UINavigationController
self.revealViewController().pushFrontViewController(myScheduleNC, animated: true) // LINE 175 IS HERE

})
alert.addAction(alertAction)
self.present(alert, animated: true, completion: nil)
} else {
print(networkStatus.networkLoaderErrorDescription)
let alert = UIAlertController(title: networkStatus.networkLoaderErrorTitle, message: networkStatus.networkLoaderErrorDescription, preferredStyle: UIAlertControllerStyle.alert)
let alertAction: UIAlertAction = UIAlertAction(title: "OK", style: UIAlertActionStyle.default, handler: nil)
alert.addAction(alertAction)
self.present(alert, animated: true, completion: nil)
}
})
}

}
}
}
}

最佳答案

添加 [weak self]在闭包的完成块中解决了这个问题。
您在 self 时偶然发现了一种罕见的情况。被释放并且在调用完成块之前为零,使用 self.使应用程序崩溃。

关于ios - 了解 Crashlytics 崩溃报告(部分适用),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47093409/

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