Xcode卡在运行playground上。

3
每次我在 playground 中运行代码时,都会抛出以下错误:
Playground execution failed:

error: /var/folders/1y/636dsz5d60s21x7j9h9517g4001lh5/T/playground3-6941f6..swift:3:37: error: expected ',' in #sourceLocation directive
#sourceLocation(file: "MyPlayground".playground", line: 1)
                                    ^    
error: /var/folders/1y/636dsz5d60s21x7j9h9517g4001lh5/T/playground3-6941f6..swift:3:48: error: unterminated string literal
#sourceLocation(file: "MyPlayground".playground", line: 1)

请帮助我...


有三个双引号。在删除 .playground 前面的 " 之后,它应该可以正常工作,这样它就会变成 "MyPlayground.playground" - Nasir
分享你的代码,这样可以帮助人们了解实际问题。 - Sunil Sharma
1个回答

1
我在使用Playground时遇到了同样的问题,原因是Xcode一直在与iCloud同步。有时由于错误行为或连接不佳而会卡在“运行”状态。
只需前往:
系统偏好设置 - Apple ID - 使用iCloud的此Mac上的应用程序 - iCloud驱动器 - 选项 - 然后取消选中“Playground”
这个小技巧可以防止同步并解决“运行”卡死的问题。

Uncheck Playground from syncing


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接