gpt4 book ai didi

ios - 错误-段错误 : 11 in Xcode 10

转载 作者:搜寻专家 更新时间:2023-10-31 23:06:50 28 4
gpt4 key购买 nike

我在 Xcode 9 中工作。代码工作正常,但是当我在 Xcode 10 中使用相同的代码时,我遇到了编译时错误。

这是错误:

1.  While emitting SIL for 'fetchConsumerRecommendations(completionHandler:failureHandler:)' at /Users/shahezad/Desktop/Newcode/foodkonnectconsumer-ios/Food/FirebaseManager.swift:2578:5
2. While silgen emitFunction SIL function "@$S4Food15FirebaseManagerC28fetchConsumerRecommendations17completionHandler07failureH0yySaySSGc_ys5Error_pSgctFZ".
for 'fetchConsumerRecommendations(completionHandler:failureHandler:)' at /Users/shahezad/Desktop/Newcode/foodkonnectconsumer-ios/Food/FirebaseManager.swift:2578:5
3. While silgen closureexpr SIL function "@$S4Food15FirebaseManagerC28fetchConsumerRecommendations17completionHandler07failureH0yySaySSGc_ys5Error_pSgctFZySo19FIRDocumentSnapshotCSg_AItcfU_".
for expression at [/Users/shahezad/Desktop/Newcode/foodkonnectconsumer-ios/Food/FirebaseManager.swift:2584:285 - line:2615:9] RangeText="{ (documentSnapshot, error) in


if error == nil {

if (documentSnapshot?.exists)!{

print("Consumer Recommendations - \(describing: documentSnapshot?.data())")

let dictOnboarding:NSDictionary = (documentSnapshot?.data())! as NSDictionary

print("\(dictOnboarding.allKeys)")

completionHandler(dictOnboarding.allKeys as! [String])

}
else{


completionHandler([])

}

}
else{

failureHandler(error)

}


}"
error: Segmentation fault: 11

我无法弄清楚这是什么代码问题。

最佳答案

也许将来有人会像下面这样在解析的 json 排序中犯我的错误:

let countryList = try? JSONDecoder().decode([Country].self, from: data)
if let countryList = countryList {
completion(countryList.sorted(by: <))
}

关于ios - 错误-段错误 : 11 in Xcode 10,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52622089/

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