I've using uiimagepickercontroller
and taken images via camera and stored into folder that was created in sandbox. That stored images are not displayed in iPads or iPhone photo gallery. I want to display those sandbox pictures in device gallery. Any one help me out from this.
My optimum goal is to copy image from sandbox and paste it to device's internal memory.
Asked
Active
Viewed 100 times
-2
-
If you wan to show image in device gallery then you need stored into image in gallery. – Nirmalsinh Rathod Jul 27 '17 at 10:39
-
Are you want to stored image in gallery? – Nirmalsinh Rathod Jul 27 '17 at 10:40
-
@Nirmalsinh you are correct I need to know how I can store images in gallery via objective c code – vignesh.P Jul 27 '17 at 10:41
1 Answers
1
You use the UIImageWriteToSavedPhotosAlbum() function.
UIImageWriteToSavedPhotosAlbum(IMAGE_TO_STORED, nil, nil, nil);
Edit:
- (IBAction)savedPhoto:(id)sender{
UIImageWriteToSavedPhotosAlbum(IMAGE_TO_STORED, nil, nil, nil);
}
Another way to stored image is:
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library saveImage:image toAlbum:nil withCompletionBlock:^(NSError *error) {
if (error!=nil)
{
NSLog(@"Error: %@", [error description]);
}
}];

Nirmalsinh Rathod
- 5,079
- 4
- 26
- 56