0

Just got Xcode 7 beta a couple days ago and my code that was working in the previous Xcode is "to complex" for the new Xcode...boggles my mind...any suggestions on how to correct this error or shorten up this variable??

using parse as my backend and just creating search texts for search bars.. thanks!

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

parseClass["searchText"] = searchText

error* Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions

Steve DeRienzo
  • 237
  • 3
  • 12
  • Have you tried just breaking it up into two different Strings? Or perhaps removing the "" - I'm not quite sure what they do. – Fred Faust Jul 24 '15 at 03:40

1 Answers1

1

As for why you're getting this error, I believe this SO answer describes it nicely.

And as a solution to the problem, I would suggest using String Interpolation:

let searchText = ("\(fullName.text) \(customerEmail.text) \(address.text) \(customerPhone.text)").lowercaseString
Community
  • 1
  • 1
Kyle H
  • 921
  • 1
  • 8
  • 20