问题描述:

After updating to Xcode 6.4 if I open a playground and do just a nominal amount of work, say copy and paste an array such as:

[["udNKIbuMJM",0,0,""],["PrZtijrbAz",0,0,""],["Sd37qzfN70",0,0,""],["KT4WRSlbYj",0,0,""],["6DCBEZuwgB",0,0,""]]

The CPU load goes through the roof. The fan starts whirring and Activity Monitor clocks it in at 198% usage. Is anyone else experiencing this? If so, any solutions out there?

The array above was originally 83 items. As soon as I noticed it wasn't compiling I shortened it down to just 3 to see if that was the issue(not that that should be an issue) but the CPU load continued to climb.

网友答案:

I pasted your array in the following:

var array = [["udNKIbuMJM",0,0,""],["PrZtijrbAz",0,0,""],["Sd37qzfN70",0,0,""],["KT4WRSlbYj",0,0,""],["6DCBEZuwgB",0,0,""]]
array.dynamicType

Activity Monitor showed a couple of XCode-related processes peaking at 200% and 110% each, then the first one went down to 150% and disappeared in about 30 seconds, while the latter took up around one minute to disappear from Activity Monitor. The above code then compiled and array.dynamicType produced a nice

Swift.Array<Swift.Array<NSObject>>

in the Results Pane on the right side of Playground. Perhaps it just took Playground a while to parse the code and create the object, but on my side all was well in a minute or so. Also, my Mac Mini did not show any signs of stress: no fan going crazy nor program execution slowing down.

相关阅读:
Top