Hi, I am using iPhone 2.0 SDK. I used the API UIImageWriteToSavedPhotosAlbum to save an image. A Saved Photos album gets created on the iPhone Simulator when I save an image but tested on the device the image gets added in the Camera Roll album. While debugging, no errors occur but the Saved Photos album is not created on the device.
A:
Depending on your device you may have to use the photo library instead. Try the following:
UIImagePickerControllerSourceType sourceType = UIImagePickerControllerSourceTypeSavedPhotosAlbum;
if ([UIImagePickerController isSourceTypeAvailable:sourceType] == NO)
sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
if ([UIImagePickerController isSourceTypeAvailable:sourceType] == YES)
{
// acquire image
}
m4rkk
2009-05-07 14:25:37
+1
A:
It's just different naming conventions between simulator (and I image iPod touch) and iPhone. Since the iPhone has a camera, the Saved Album is called "Camera Roll". Since the simulator doesn't have a camera, the Saved Album is called "Saved Photos" (or whatever).
Using UIImageWriteToSavedPhotosAlbum() should write the photo to the appropriate album.
If the image is being saved to Camera Roll on your iPhone, then your code is working properly.
Martin Gordon
2009-05-28 20:20:31