display an image from online into imageview of iphone and save in to database
<p>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.</p>

<pre><code>UIImage *image = [[UIImage alloc] initWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:@"http://tvaraj.files.wordpress.com/2012/03/sachin-tendulkar-when-young.jpg&amp;w=231&amp;h=2500&amp;ei=SiKqT9-fKILprQfIudWCAQ&amp;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];
</code></pre>

<p>My requirement is if I click any image that should display in the imageview.</p>

<p>How is it possible?</p>
