2010-07-29 15 views

回答

0

對不起一個人在上面改變回復。 使用url的編碼。

NSString * myurl = [yoururl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

2

- (IBAction爲)buttonPressed:(ID)發送{

NSLog(@"button pressed"); 

//|=%7c [pipe], you can used NSString *myurl=[yoururl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 

NSString* [email protected]"your google chart url"; 

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; 

}

+0

非常感謝...我會試試看。 – David 2010-07-29 12:45:59

+0

嘿它工作...謝謝:) – David 2010-07-30 18:07:02