I m a new developer in iphone... please help...
+2
A:
-(IBAction)buttonPressed:(id)sender{
NSLog(@"button pressed");
//|=%7c [pipe]
NSString* myurl=@"http://chart.apis.google.com/chart?cht=pc&chd=t:120,45%7c120,60,50,70,60&chs=300x200&chl=%7c%7chelo%7cwrd%7cindia%7cpak%7cban&chco=FFFFFF%7cFFFFFF,e72a28%7ca9d331%7cffce08%7c8a2585%7c184a7d";
NSMutableURLRequest *theRequest=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:myurl] cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:60.0];
NSURLResponse* response;
NSError* error;
NSData *imageData=[NSURLConnection sendSynchronousRequest:theRequest returningResponse:&response error:&error];
NSLog(@"%@",error);
NSLog(@"%@",response);
NSLog(@"%@",imageData);
UIImage *myimage = [[UIImage alloc] initWithData:imageData];
self.ringImge.image=myimage;
}
Mayur Birari
2010-07-29 12:34:31
@Mayur Thanks a lot... i will try it.
David
2010-07-29 12:45:59
hey it worked... Thanks :)
David
2010-07-30 18:07:02
A:
sorry people one alteration in the above reply. use encoding for the url.
NSString *myurl=[yoururl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
David
2010-08-05 13:16:11