I want to dispay an online image in imageview and save it to database following code display only a particular image. I can also save that image to database.
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];
My requirement is if I click any image that should display in the imageview.
How is it possible?