Swift Playground - 如何使用"线程返回-x"

Kuk*_*ula 6 swift swift-playground

我写的时候调用了以下错误case 2841001 ... 393200 :我发现了我的错误(在第一个数字中有一个额外的数字,复制粘贴错误),但我很想学习如何使用"线程返回-x",我在哪里配置?

Playground execution aborted: Execution was interrupted, reason: EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0).
The process has been left at the point where it was interrupted, use "thread return -x" to return to the state before expression evaluation.
Run Code Online (Sandbox Code Playgroud)

aya*_*aio 5

我找不到有关此错误消息的正式文档,但我的解释是:

这是一条LLDB错误消息,我们不应该在Playground中看到此消息,因为我们无法访问Playground中的调试器。

在常规Xcode项目中,我们可以使用调试器在调试会话中进行导航,例如:

(lldb) thread continue
Run Code Online (Sandbox Code Playgroud)

但这在Playground中是不可能的,所以我认为在Playground中看到此错误是Xcode错误。