-1
我想在图像视图中显示在线图像并将其保存到数据库 下面的代码仅显示特定图像。我也可以将该图像保存到数据库。将图像从在线显示到iphone的imageview并保存到数据库中
UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://tvaraj.files.wordpress.com/2012/03/sachin-tendulkar-when-young.jpg&w=231&h=2500&ei=SiKqT9-fKILprQfIudWCAQ&zoom=1"]]];
NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSData *data1 = [NSData dataWithData:UIImagePNGRepresentation(image)];
img.image=[UIImage imageWithData:data1];
NSLog(@"image=%@",img.image);
imageToUse1= img.image;
[image release];
//i want to add this code. this is for
WebView *Wview=[[WebView alloc]init];
[self.navigationController pushViewController:Wview animated:YES];
我的要求是,如果我点击任何图像,应该在imageview中显示。
这怎么可能?
我已经试过这个code.this是只有一个image.my的要求是选择一个图像从多个图像 –
您可以使用'for'循环显示来自服务器的多个图像。 – akk
我可以得到任何示例代码 –