【问题标题】:Expression was to complex to be solved in reasonable time...xcode 7 beta表达式过于复杂,需要在合理的时间内解决……xcode 7 beta
【发布时间】:2015-07-24 03:23:22
【问题描述】:

几天前刚拿到 Xcode 7 测试版,我在以前的 Xcode 中运行的代码对于新的 Xcode 来说“太复杂”了……让我大吃一惊……关于如何纠正这个错误或缩短的任何建议增加这个变量??

使用 parse 作为我的后端,只为搜索栏创建搜索文本.. 谢谢!

let searchText = (fullName.text + ""  + customerEmail.text + "" + address.text + "" + customerPhone.text).lowercaseString

parseClass["searchText"] = searchText

error* 表达式太复杂,无法在合理时间内解决;考虑将表达式分解为不同的子表达式

【问题讨论】:

  • 你试过把它分成两个不同的字符串吗?或者也许删除“” - 我不太确定他们做了什么。

标签: xcode swift parse-platform


【解决方案1】:

至于为什么你会收到这个错误,我相信this SO answer很好地描述了它。

作为问题的解决方案,我建议使用字符串插值:

let searchText = ("\(fullName.text) \(customerEmail.text) \(address.text) \(customerPhone.text)").lowercaseString

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-09
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多