so I'm shooting up a camera (Ipad, 5.0, ARC), allow me to take picture.. it gives you a preview after taking the picture. The two options are "use" and "retake" in the preview. I'm unsure where you attempt to define the name of the photo and store in the camera roll. Even via NSLog I can't see anything called w/ the use button.. the tutorials don't seem to be working for me either. There's one that Ipad specific on technopedia that most people reference.
Asked
Active
Viewed 3,425 times
2
-
What do you mean by "name" of the photo? – Stavash Feb 24 '12 at 15:23
-
I'd like to custom name the image.. but really that's not important. I've actually read it's not possible.. but who knows.. regardless I just want to save the image. – DJPlayer Feb 24 '12 at 15:26
1 Answers
10
So you are using a UIImagePickerController
to take a picture on the iPad, and you want to know how to save it? For this, you need to be the delegate of the UIImagePickerController, then implement the following method:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
In this delegate callback you can get the UIImage
that was just taken by getting the value of the info dictionary with key UIImagePickerControllerOriginalImage
. To then save this image to the camera roll, you use:
void UIImageWriteToSavedPhotosAlbum (UIImage *image, id completionTarget, SEL completionSelector, void *contextInfo);
There is no such thing as an image name in the iOS assets library, so you cannot name the image.
It is also possible to save the image using the Assets Library, see this post for more details.
-
well that worked at saving the image.. but I tried to save take another picture and save another image.. didn't work.. didn't even overwrite the image. – DJPlayer Feb 24 '12 at 16:00