1
我馬雲在iphone新的開發......請幫助...如何訪問目標c(iphone)中的google API圖表?
我馬雲在iphone新的開發......請幫助...如何訪問目標c(iphone)中的google API圖表?
對不起一個人在上面改變回復。 使用url的編碼。
NSString * myurl = [yoururl stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
- (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;
}
非常感謝...我會試試看。 – David 2010-07-29 12:45:59
嘿它工作...謝謝:) – David 2010-07-30 18:07:02