swift - 线程 1:信号 SIGABRT 因为 NavigationView -> List -> Section 中的按钮
问题描述
从 Xcode 12 开始,我有一个Thread 1: signal SIGABRT,这里是错误的详细信息:
2020-10-20 00:01:20.989409+0200 App[23604:1417143] 前置条件失败:导入的节点在读取其值之前被删除:90
当我快速更改选项卡时会出现崩溃。
我认为崩溃来自 ReSwift,但经过调查,当我评论按钮时,崩溃消失了(我试图只评论调度,但应用程序仍然崩溃)。这是代码:
struct Profile: View {
@ObservedObject private var state = ObservableState(store: appStore)
var genderOptions = ["♂️ Male", "♀️ Female", " Other"]
var body: some View {
NavigationView {
List {
Section(header: Text("Manage account")) {
NavigationLink(destination: ChangePassword()) {
Text("Change password")
.foregroundColor(.blue)
}
Button(action: {
self.state.dispatch(signOut(state: self.state.current, store: appStore))
}) {
Text("Deconexion")
}
NavigationLink(destination: DeleteAccount()) {
Text("Delete account")
.foregroundColor(.red)
}
}
}
.font(.system(size: 17))
.listStyle(GroupedListStyle())
.environment(\.horizontalSizeClass, .regular)
.navigationBarTitle(Text((self.state.current.firebaseAuthState.userDetail?.firstName)!))
}
}
}
我不明白为什么这个按钮会引发这样的崩溃。
先感谢您。
解决方案
推荐阅读
- python - Flask:将url路径传递给类构造函数
- java - Android Studio github 库实现
- rust - 为什么`const`上的可变引用不是错误?
- bash - 使用 csv 在 Bash 中执行 for 循环并在 Internet 上下载文件
- wso2 - WSO2 是 5.11.0 IWA NTLM / KERBEROS
- python - Python数学运算直到按下'n'
- python - /categories 'category' 处的 MultiValueDictKeyError
- javascript - 在 JMeter 中使用预处理器执行 HTTPS 请求
- c# - 显示属性的所有可能的 NullReferenceExceptions
- c# - 在发布版本中的 .net 框架中出现 cors 错误