gpt4 book ai didi

ios - Firebase crashlytics 报告我的生产构建中有许多 line 0 崩溃,这些崩溃是真的吗?

转载 作者:行者123 更新时间:2023-11-28 05:46:37 25 4
gpt4 key购买 nike

我在我的 swift 项目中使用 websocket,从最近几周开始,我收到了这些崩溃:

< compiler-generated > line 0

Crashed: com.MyProject.Channel
0 MYProject 0x100e53f7c specialized Arrayat(_:) (<compiler-generated>)
1 MYProject 0x100e55a3c $S6MYProject7ChannelC20checkResponseMessage33_12B1408E1049A8D244FCDCBD3CEC 8679LL08responseE0yAA0bE0C_tFyyXEfU_ (Channel.swift:137)
2 MYProject 0x100ce3de8 $SIg_Ieg_TR (<compiler-generated>)
3 MYProject 0x100ce3e08 $SIeg_IyB_TR (<compiler-generated>)

代码中的更多信息:

Channel.TMLock.sync {
var idx = 0
for msg in Channel.trackedMsgs {
mt = msg
if msg.isResponseTo(responseMessage: responseMessage) {
Channel.trackedMsgs.remove(at: idx)
break
}

idx += 0
}
}

Channel.swift:137 => Channel.trackedMsgs.remove(at: idx)

有人知道吗?

最佳答案

Channel.TMLock.sync {
var idx = 0
for msg in Channel.trackedMsgs {
mt = msg
if msg.isResponseTo(responseMessage: responseMessage) {
Channel.trackedMsgs.remove(at: idx) -> Removing elements while iteration will cause crash
break
}

idx += 0
}
}

您可以将其重写为:

Channel.TMLock.sync {
var idx = 0
var indexOfElement = 0
while indexOfElement < Channel.trackedMsgs.length{
mt = msg
if msg.isResponseTo(responseMessage: responseMessage) {
Channel.trackedMsgs.remove(at: idx)
break
}

idx += 0
indexOfElement += 1
}
}

关于ios - Firebase crashlytics 报告我的生产构建中有许多 <compiler-generated> line 0 崩溃,这些崩溃是真的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54441540/

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