我是 iPhone 的新手。我想从 url 获取图像
我尝试了休闲代码
-(void)viewDidLoad
{
UIImageView *UV=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)];
[self.view addSubview:UV];
NSURL *url = [NSURL URLWithString:@"http://www.google.com/recaptcha/api/noscript?k=6LdON9USAAAAAO9AtfFsuLxBY1l-yNDBoJcb1Jeb"];
NSData *myData = [NSData dataWithContentsOfURL:url];
UIImage *image = [[UIImage alloc] initWithData:myData];
UV.image=image;
}
但图像未显示在图像视图中。任何人都可以帮助我提前谢谢