如何在 Xcode 中显示 Logged Messages 窗口
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/483493/
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
How to show the Logged Messages window in Xcode
提问by xaddict
I'm a very new Cocoa user and running into all sorts of problems...
我是一个非常新的 Cocoa 用户,遇到了各种各样的问题......
I'm trying to get the content of an Array and found this code to do this.
我正在尝试获取数组的内容并找到了此代码来执行此操作。
NSLog(@"array : %@",collection);
NSLog(@"数组: %@",collection);
The problem is, I'm not getting any console or tracer window that shows this 'echo'
问题是,我没有收到任何显示此“回声”的控制台或跟踪器窗口
Is there another command I should use, i've tried opening all windows but I don't see the message that should show. I know the function that this call is in is executed, so the reference is right.
有没有我应该使用的另一个命令,我已经尝试打开所有窗口,但我没有看到应该显示的消息。我知道这个调用所在的函数被执行了,所以引用是对的。
Thanks and sorry for these beginner questions... Using stackoverflow is way faster than reading through all the documentation apple has regarding the subject.
感谢和抱歉这些初学者问题......使用 stackoverflow 比阅读苹果有关该主题的所有文档要快得多。
采纳答案by Genericrich
When Xcode runs your project, the editor changes to show a little black button with the letters "GDB" in it. Click on that to see the Debugger which has the console in it.
当 Xcode 运行您的项目时,编辑器会更改为显示一个带有字母“GDB”的黑色小按钮。单击它以查看其中包含控制台的调试器。
Good luck!
祝你好运!
Oh, and I would read Apple's documentation. It's not that bad.
哦,我会阅读 Apple 的文档。它没有那么坏。
回答by richBossa
From the 'Run' menu, choose 'Console' - keyboard shortcut is Shift-Cmd-R.
从“运行”菜单中,选择“控制台” - 键盘快捷键是 Shift-Cmd-R。
回答by Andy A
In later versions of xcode, do shift + cmd + R.
在更高版本的 xcode 中,执行 shift + cmd + R。
Or go to View -> Debug Area -> Activate Console
或者去查看 -> 调试区 -> 激活控制台
回答by Ryan Townshend
In the Xcode menu hit Run- Console. This is where NSLog / print / printf etc statements output.
在 Xcode 菜单中点击Run- Console。这是 NSLog/print/printf 等语句输出的地方。
The key command is Command + Shift + R.
关键命令是Command + Shift + R。
The cocoa toString()method is called descriptionas well.
可可的toString()方法也称为描述。
NSLog(@"array : %@",collection);
Will execute
将执行
NSLog(@"array : %@",[collection description]);
Which will then call description on each of the collections elements.
然后将调用每个集合元素的描述。
回答by Lounges
If you want to see it every time you run your application select the "Debugging" tab from the preferences window and change the box that says "On Start" to "Show Console". Additionally i like to check the "Auto Clear Debug Console" checkbox which will clear out the text of the output on starting your application.
如果您想在每次运行应用程序时都看到它,请从首选项窗口中选择“调试”选项卡,并将“启动时”框更改为“显示控制台”。此外,我喜欢选中“自动清除调试控制台”复选框,它将在启动应用程序时清除输出文本。