tags:

views:

35

answers:

1

I'm pulling in a UIImage from an NSURL (as data) and I need to set the frame based on the size of the image. However, the image.size.width always comes back as 0, and image.size.height comes back as a large number (my guess is the total number of bytes in the image). Is there any way to get the proper values after an image has been downloaded?

+3  A: 

Sounds like you're printing the width and height as integers. They're CGFloats.

Or, do this to print the size:

NSLog(@"%@", NSStringFromCGSize(theImage.size));
Thomas Müller
Good call! Didn't even occur to me!
mahboudz
AAAGGGHHH! :-) I can't believe I did that *again*. Sigh -- thank you! (now to figure out why it's reporting the *wrong* values...)
Jeffrey Berthiaume