Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

usuf2484

macrumors newbie
Original poster
Jun 30, 2009
2
0
Hi,

I have got the data for a .jpg image from the url like below

NSData *imageData = nil;
NSURL *url = [NSURL URLWithString:someurl.jpg];

imageData = [NSData dataWithContentsOfURL:url];

I can see that data has come, now i try to create image out of this data

UIImage *theImage = [[[UIImage alloc] initWithData:imageData] autorelease];

But theImage always is 0x0.

I tried using initWithContents of file and as well as the class functions in the UIImage class but no luck.

The image gets displayed on the browser.

Can any one please help with this regard, what am i doing wrong.

Thanks and Regards,
U'suf
 
Got it!

It was my network proxy problem... It was blocking the url and sending me a html file instead of the image stating it could not authenticate..
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.