gpt4 book ai didi

ios - 生产应用程序崩溃报告 <编译器生成>

转载 作者:行者123 更新时间:2023-11-28 23:22:06 31 4
gpt4 key购买 nike

我无法为应用商店中的某些应用用户重新创建崩溃,我无法弄清楚。

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000010008d180
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [3253]
Triggered by Thread: 0

Thread 0 name:
Thread 0 Crashed:
0 FGS 0x000000010008d180 LoginViewController.setupUI() + 896 (<compiler-generated>:94)
1 FGS 0x000000010008cde4 @objc LoginViewController.viewDidLoad() + 96 (LoginViewController.swift:87)
2 UIKitCore 0x00000001a0c64364 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 104 (UIViewController.m:2252)
3 UIKitCore 0x00000001a0c68f98 -[UIViewController loadViewIfRequired] + 952 (UIViewController.m:3351)
4 UIKitCore 0x00000001a0bd7c88 -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 172 (UINavigationController.m:6332)
5 UIKitCore 0x00000001a0bd7f9c -[UINavigationController _startTransition:fromViewController:toViewController:] + 180 (UINavigationController.m:6367)
6 UIKitCore 0x00000001a0bd8db4 -[UINavigationController _startDeferredTransitionIfNeeded:] + 1104 (UINavigationController.m:6579)
7 UIKitCore 0x00000001a0bda0f8 -[UINavigationController __viewWillLayoutSubviews] + 168 (UINavigationController.m:6853)
8 UIKitCore 0x00000001a0bbd4e0 -[UILayoutContainerView layoutSubviews] + 228 (UILayoutContainerView.m:86)
9 UIKitCore 0x00000001a1747abc -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 2156 (UIView.m:16956)
10 libobjc.A.dylib 0x000000019cf1faf0 -[NSObject performSelector:withObject:] + 68 (NSObject.mm:2182)
11 QuartzCore 0x00000001a3ce60f4 -[CALayer layoutSublayers] + 292 (CALayer.mm:9582)
12 QuartzCore 0x00000001a3ce63fc CA::Layer::layout_if_needed(CA::Transaction*) + 484 (CALayer.mm:9459)
13 QuartzCore 0x00000001a3cf9964 CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 140 (CALayer.mm:2434)
14 QuartzCore 0x00000001a3c3ec1c CA::Context::commit_transaction(CA::Transaction*, double) + 308 (CAContextInternal.mm:1991)
15 QuartzCore 0x00000001a3c69bd8 CA::Transaction::commit() + 684 (CATransactionInternal.mm:438)
16 UIKitCore 0x00000001a12b7788 __34-[UIApplication _firstCommitBlock]_block_invoke_2 + 84 (UIApplication.m:10823)
17 CoreFoundation 0x000000019d18507c __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 28 (CFRunLoop.c:1774)
18 CoreFoundation 0x000000019d184800 __CFRunLoopDoBlocks + 268 (CFRunLoop.c:1815)
19 CoreFoundation 0x000000019d17f800 __CFRunLoopRun + 1088 (CFRunLoop.c:2884)
20 CoreFoundation 0x000000019d17f098 CFRunLoopRunSpecific + 480 (CFRunLoop.c:3192)
21 GraphicsServices 0x00000001a72e9534 GSEventRunModal + 108 (GSEvent.c:2246)
22 UIKitCore 0x00000001a129f7ac UIApplicationMain + 1940 (UIApplication.m:4753)
23 FGS 0x000000010000da5c main + 68 (PolicyTableViewCell.swift:31)
24 libdyld.dylib 0x000000019cffef30 start + 4

它说它在 LoginViewController setupUI 中崩溃,这是该函数中的代码:

private func setupUI() {
let hour = Calendar.current.component(.hour, from: Date())
var greetingMessage: String = ""

switch hour {
case 5..<12:
greetingMessage = "Good morning"
case 12..<18:
greetingMessage = "Good afternoon"
case 18..<24:
greetingMessage = "Good evening"
case 24..<5:
greetingMessage = "Good night"
default:
break
}

//Using keychain to store user name is case of app deletion, so if reinstalled, will remember him and greet him again.
if let fgsUser = keychain.get(Constants.kFgsUser) {
goodMorningLabel.text =
"""
\(greetingMessage)
\(fgsUser)
"""
}
else {
goodMorningLabel.text = greetingMessage
}
}

对于钥匙串(keychain)部分,我使用的是 KeychainSwift 17.0 版

最佳答案

您需要更改最后一个案例。

你需要用 0 替换 24。

private func setupUI() {
let hour = Calendar.current.component(.hour, from: Date())
var greetingMessage: String = ""

switch hour {
case 5..<12:
greetingMessage = "Good morning"
case 12..<18:
greetingMessage = "Good afternoon"
case 18..<24:
greetingMessage = "Good evening"
case 0..<5:
greetingMessage = "Good night"
default:
break
}

//Using keychain to store user name is case of app deletion, so if reinstalled, will remember him and greet him again.
if let fgsUser = keychain.get(Constants.kFgsUser) {
goodMorningLabel.text =
"""
\(greetingMessage)
\(fgsUser)
"""
}
else {
goodMorningLabel.text = greetingMessage
}
}

关于ios - 生产应用程序崩溃报告 <编译器生成>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59489872/

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