I am making a small application where I am receiving images from web-service. I am getting the image url. And the format of images is different different like .jpg,.gif,.png
after you retrieve your images/url save them this way:
NSData *imageData = UIImagePNGRepresentation(image);
[imageData writeToFile:savedImagePath atomically:YES];
Would it not be easier if you use an image library like SDWebImage which handles all the asynchronous image downloading and caching of the image onto your device?
https://github.com/rs/SDWebImage
Then you can do something like:
[myImageView setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"]
placeholderImage:[UIImage imageNamed:@"placeholder.png"]];