我喜欢使用 Xcode 调试器。您可以查看变量的值,甚至可以更改它。
但是我可以以某种方式显示图像变量引用的图像吗?我知道我可以看到它的原始字节,但是显示包含其内容的窗口会更加人性化。
Xcode 可能不支持此功能。也许有一个外部工具可以帮助显示图像?
最佳答案
使用快速查看在 Xcode 调试器中检查图像。
在调试器中选择一个 NSImage
或 UIImage
,然后单击“快速查看”“眼睛”图标。
与 OS X 的其他区域一样,您也可以使用空格键进行快速查看!
调试器中的快速查看也可以为您自己的类实现:
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/