Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode debugging - displaying images

I love using the Xcode debugger. You can take a look at a variable's value and even change it.

But can I somehow DISPLAY the image that is referenced by an image variable? I know I can see its raw bytes, but it would be much more human-friendly to display a window with its contents.

Xcode might not support this. Maybe there is an external tool that would help display images?

like image 863
krasnyk Avatar asked May 06 '10 11:05

krasnyk


People also ask

How do I show debug in Xcode?

When you run an application in Xcode, the debugger is automatically started and attached to the process of the application. Click the Run button in the top left or press Command + R. From the moment the application is up and running, we can start inspecting the process and, if necessary, debug it.

How do I see console in Xcode?

Go to Xcode → Preferences → Debugging → On Start → "Show Console".


1 Answers

Use Quick Look to inspect images in the Xcode debugger.

Select an NSImage or UIImage in the debugger, then click the Quick Look "eye" icon.

"eye" icon in Xcode debugger toolbar

Like other areas of OS X, you can also use spacebar to Quick Look!

Viewing a UIImage in the Xcode debugger via Quick Look

Quick Look in the debugger can also be implemented for your own classes:

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.

like image 184
pkamb Avatar answered Oct 21 '22 09:10

pkamb