I have searched everywhere and cannot find a definite answer about this.
When I pick an image form the photo library I would like to save it to a file and reload it the next time the user runs the app.
How exactly can I get the image the user picked and save it somewhere to access later.
I tried this but it dies not seem to save the image:
Any ideas?
Thanks
When I pick an image form the photo library I would like to save it to a file and reload it the next time the user runs the app.
How exactly can I get the image the user picked and save it somewhere to access later.
I tried this but it dies not seem to save the image:
Code:
NSString *newFilePath = [NSHomeDirectory() stringByAppendingPathComponent: @"ChosenPic.jpg"];
NSData * imageData = UIImageJPEGRepresentation(image, 1.0);
//data = imageData;
if (imageData != nil) {
NSLog(@"HERE [%@]", newFilePath);
[imageData writeToFile:newFilePath atomically:YES];
}
imageView.image =[UIImage imageNamed:newFilePath];
Any ideas?
Thanks