开发者

Load google chart image url in iOS App

I want to show concentric pie chart from google chart api but the imageData variable returns null value and image doesn't loaded.

Please check following code for reference:

NSData *imageData = [[NSData alloc] initWithContentsOfURL:[NSURL 

URLWithString:@"http://chart.apis.google.com/chart?cht=pc&chd=t:120,45|120,60,50,70,60&chs=300x200&chl=||helo|wrd|india|pak|ban&chco=FFFFFF|FFFFFF,e72a28|a9d331|ffce08|8a2585|184a7d"]]; UIImage *myimage = [[UIImage alloc] initWithData:imageData]; self.myImageView.image=myimage;

Help me t开发者_如何学Co solved this issue.


used url string encoding method to recover from this problem,

like this-

NSString *str=@"your respected url";
NSString *myurl=[str stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜