Following works fine:-
let parameters:[String:AnyObject] = [
"WebKey": API.WebKey.value,
"UID":NSUserDefaults.standardUserDefaults().integerForKey("UserId"),
"TotalCount":myData!.count,
"Qty": (myData!.map {
String($0.quantity)
}).joinWithSeparator(",")
]
However, Following gives an issue:
let parameters:[String:AnyObject] = [
"WebKey": API.WebKey.value,
"UID":NSUserDefaults.standardUserDefaults().integerForKey("UserId"),
"TotalCount":myData!.count,
"Qty": (myData!.map {
String($0.quantity)
}).joinWithSeparator(","),
"Price": (myData!.map {
String($0.price)
}).joinWithSeparator(","),
"Code": (myData!.map {
String($0.code)
}).joinWithSeparator(","),
"ReqTime":NSDate().timeFormat()
]
Issue : Expression was too complex to be solved in reasonable time; consider breaking up the expression into distinct sub-expressions
Can someone please explain why compiler is giving this issue. Also suggest a elegant way to accomplish the same implementation without the same issue. (As same logical implementation is repeated 3 times instead of one )