Question

I'm trying the Quick Look feature of the new Xcode 5 to be able to see my images in the debugging pane but I'm getting this message that my images cannot be previewed with Quick Look, it says "Could not load Quick Look data for "image"", where "image" is the name of my variable.

Does this happen because of the size of the image or is there any other thing to consider? My image's size is kind of big like (width=2448, height=1224)

Thanks!

Was it helpful?

Solution 2

I suggest you open the variables pane of the debugger when the image variable is active. Right click and add an expression which should be the image variable reference. After selecting the expression I would try to click on the Quick Look icon that will be enabled at the bottom of the variable screen. Please advise if this does not help otherwise feel free to accept the answer.

(e.g.) cell.imageView.image

Quick Look

OTHER TIPS

For only debug purposes when I definitely need the image (and can't normally quick look at it) I'm able to see it using following pattern:

CGImageRef imageRef = image.CGImage;
CGImageRelease(imageRef); // put breakpoint here

Then i need to quick look at imageRef. Do not forget to remove this line of code when you catch the bug as it eats device resources and is spare :)

BTW: Tommie's solution didn't work for me.

Here's a small modification of @Vive's solution that works for me, and doesn't require freeing the image.

// create volatile variable so compiler doesn't optimize it out      
volatile CGImageRef dbgRef = image.CGImage;

// silence unused warning
(void)dbgRef;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top