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
2009-11-12 05:17:03
Good call! Didn't even occur to me!
mahboudz
2009-11-12 05:32:45
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
2009-11-12 15:18:34