Xcode 10 playground 未显示输出 [英] Xcode 10 playground is not showing the output

查看:55
本文介绍了Xcode 10 playground 未显示输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 macOS Mojave 10.14.4 上使用 Xcode 10.当我打开操场时,我无法让输出窗口输出任何内容,即使使用打印命令它也保持空白.是否有任何其他适用于 mac 的程序可以在您快速编码时显示输出?或者有没有人遇到过并且能够解决这个问题?

I am using Xcode 10 on macOS Mojave 10.14.4. When I open the playground I am unable to get the output window to output anything, even using the print command it stays blank. Is there any other program for mac that shows output as you code in swift? Or has anyone encountered and was able to fix this problem?

推荐答案

Swift Playground 可能不稳定.要查看任何输出,您首先必须运行 Playground.看一个空的 Mac playground 的屏幕截图,我在其中添加了一行来打印 str 变量的内容:

Swift playgrounds can be flaky. To see any output you first have to run the playground. Look at the screenshot of an empty Mac playground where I added a line to print the contents of the str variable:

如果您将鼠标移到编辑器的左侧,将出现一个运行按钮,您可以在屏幕截图的第 3 行看到该按钮.单击该按钮将运行该行代码.单击运行操场按钮将运行整个操场.结果将显示在窗口的右侧.一些输出也会出现在调试区.

If you move the mouse over the left side of the editor, a Run button will appear, which you can see at Line 3 in the screenshot. Clicking that button will run that line of code. Clicking the Run playground button will run the whole playground. The results will appear in the right side of the window. Some output will also appear in the debug area.

这篇关于Xcode 10 playground 未显示输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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