gpt4 book ai didi

ios - "Expression was too complex to be solved in reasonable time"在 swift 3 中向字典添加数据时,在 swift 2.3 中工作正常

转载 作者:行者123 更新时间:2023-11-29 00:36:19 25 4
gpt4 key购买 nike

let parameters : [String : AnyObject] = [
"address" : txtAddress.text ?? "",
"person_name" : txtAuthorName.text ?? "",
"person_image" : imgUrl ?? "",
"book_title" : txtBookTitle.text ?? "",
"dedicated_to" : txtDedicatedTo.text ?? "" ,
"person_about" : txtAboutTheAuthor.text ?? "",
"is_published" : false,
"recipes" : recipeArr ?? ""]

这是向字典添加数据的代码。在 Swift2.3 上运行良好。

Swift 3 编译器表示将表达式分解为子表达式。

请提出一个合适的解决方案。

最佳答案

以下面的方式打破它对我来说效果很好

var dictionary =  [String: Any]()
dictionary["key1"] = value1
dictionary["key2"] = value2
//...

关于ios - "Expression was too complex to be solved in reasonable time"在 swift 3 中向字典添加数据时,在 swift 2.3 中工作正常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40526914/

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