views:

57

answers:

2

Hi All, I am using google chart functionality in iPhone app....I want to download image and put it into UIImageView from http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World ... Is there any sample app for doing such functionality?or any other way to display charts in app?

Thanks in advance...

A: 

Try imageView.image = [UIImage imageWithData:[NSData dataWithContentsOfURL:aURL]]

tob
I hv done with that but it is not working....thanks for ur reply
iSwap
+1  A: 

This would block, use NSURLConnection for non-blocking download

NSData *imageData = [NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://chart.apis.google.com/chart?cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World"]];

UIImage *downloadedImage = [UIImage imageWithData:imageData];

myImageView.image = downloadedImage;
willcodejavaforfood
Its working with NSURLConnection ....Thanks....
iSwap
Happy to help :)
willcodejavaforfood