tags:

views:

37

answers:

2

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
@Mayur Thanks a lot... i will try it.
David
hey it worked... Thanks :)
David
A: 

sorry people one alteration in the above reply. use encoding for the url.

NSString *myurl=[yoururl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

David