有调试器支持的Swift游乐场吗? [英] Swift playground with debugger support?

查看:63
本文介绍了有调试器支持的Swift游乐场吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Xcode 7中的快速游乐场似乎不支持调试器的使用.这个功能似乎(非常)有用……

Swift playgrounds in Xcode 7 don't seem to support usage of the debugger. This features seems like it would be (extremely) useful ...

我有一个操场,可以在我编写的框架内练习代码.我真的很想能够在我的框架中的代码上设置一个断点,并且让调试器在从操场上执行代码时在遇到断点时停止执行.有人知道为什么游乐场目前不支持吗?是否有一些根本原因导致游乐场不能支持该功能,或者该功能将来可能会出现?

I've got a playground that exercises code within a framework I'm writing. I'd really love to be able to set a breakpoint on the code within my framework -- and have the debugger stop execution when the breakpoint is hit when the code is executed from a playground. Does anyone know why playgrounds don't currently support this? Is there some fundamental reason why a playground couldn't support this or might this be a feature that could come in the future?

推荐答案

Xcode的Playground中没有调试器.但是,在代码的右侧,执行该行代码时,您应该看到每个表达式的值.如果多次执行该操作,您只会看到(X次)",但是您可以单击蓝点并随时间查看图形或列表中的值.

There is no debugger in the Playground in Xcode. However in the right of the code, you should see the value of each expression when that line of code is executed. If it is executed multiple times, you’ll just see "(X times)", but you can click the blue dot and see the values over time, either as a graph or a list.

如果要使用默认的 print(")表达式打印出值,请确保启用助手编辑器:

If you want to print out values with the default print("") expression, make sure that you enable the assistant editor:

查看>助手编辑器>显示助手编辑器

View > Assistant editor > Show Assistant editor

这篇关于有调试器支持的Swift游乐场吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆