Xcode调试-显示图像

标签 xcode debugging

我喜欢使用 Xcode 调试器。您可以查看变量的值,甚至可以更改它。

但是我可以以某种方式显示图像变量引用的图像吗?我知道我可以看到它的原始字节,但是显示包含其内容的窗口会更加人性化。

Xcode 可能不支持此功能。也许有一个外部工具可以帮助显示图像?

最佳答案

使用快速查看在 Xcode 调试器中检查图像。

在调试器中选择一个 NSImageUIImage,然后单击“快速查看”“眼睛”图标。

"eye" icon in Xcode debugger toolbar

与 OS X 的其他区域一样,您也可以使用空格键进行快速查看!

Viewing a UIImage in the Xcode debugger via Quick Look

调试器中的快速查看也可以为您自己的类实现:

Enabling Quick Look for Custom Types

The variables Quick Look feature in the Xcode debugger allows you to obtain a quick visual assessment of the state of an object variable through a graphical rendering, displayed in a popover window either in the debugger variables view or in place in your source code.

This chapter describes how you implement a Quick Look method for your custom class types so that object variables of those types can also be rendered visually in the Quick Look popover window.

关于Xcode调试-显示图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2780793/

相关文章:

ios - 什么时候在 Objective-C 中使用 self?

ios - 在 iOS 表格中显示响应图像和标签

c++ - Xcode 中的 Objective-C++ 和 .cpp 文件

c++ - 如何在 OS X 10.10 上的 Xcode 6 中提供库框架?

node.js - 在 VS Code 中调试 Angular Universal Starter App 的服务器端不起作用

objective-c - 核心数据内存使用和内存警告

java - 在 Eclipse 中调试时实时更改变量?

.net - Visual Studio "Start Debugging"与 "Attach to Process"

java - 在 Eclipse IDE 中调试 Java 时将异常捕获为表达式

c++ - Qt5.natvis 在 VS 2015 Update 2 中不起作用