Load nsimage from url but only some url's work
- by happyCoding25
I have some code that loads an image file off the web and puts it in an image view. The problem is it works with everything but Google Charts. This is frustrating because I was relying on this to graph data for my app. Heres the url I need to load: Click to see my test chart. Im not sure why NSImage seems to refuse to load this when it works with everything elese. If you know why or have a work-around any help is appreciated.
Heres some sample code I found that I'm using to load the images:
NSURL *imageURL = [NSURL URLWithString:@"http://chart.apis.google.com/chart?cht=p3&chs=700x400&chd=t:20,20,20,20,20&chl=A|B|C|D|E&chco=66FF33,3333CC"];
NSLog(@"url");
NSData *imageData = [imageURL resourceDataUsingCache:NO];
NSLog(@"data");
NSImage *imageFromBundle = [[NSImage alloc] initWithData:imageData];
(Note: This code will load any image except a chart)
Thanks