Xcode 8 (Swift) 控制台中没有打印输出

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/39676073/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 09:20:51  来源:igfitidea点击:

Xcode 8 (Swift) No print output in Console

swiftxcodeloggingconsoleoutput

提问by Alex Pilugin

The question in the topic: Why no print output in Console using Simulator? Is it disabled or this is a bug?

主题中的问题:为什么使用模拟器在控制台中没有打印输出?它是禁用的还是这是一个错误?

回答by Nazmul Hasan

Try with this way

用这种方式试试

View --> Debug Area --> Activate Console

查看 --> 调试区 --> 激活控制台

回答by Edess Elder

same answer as @Nazmul Hasan, but with an image to help others.

与@Nazmul Hasan 相同的答案,但有一个帮助他人的形象。

enter image description here

在此处输入图片说明

回答by fafa

I found that you could not type print("the data you want to print")in normal class with no type.

我发现你不能print("the data you want to print")在没有类型的普通班级中输入。

You need to type this code in general viewController, such as UIViewControlleror UITableViewController.

您通常需要键入此代码viewController,例如UIViewControllerUITableViewController