I think the problem is that you are setting sourceType to UIImagePickerControllerSourceTypeSavedPhotosAlbum, no matter what type of sourceType is supported.
i.e. The next line should be conditional;
[picker setSourceType:UIImagePickerControllerSourceTypeSavedPhotosAlbum]
Instead, put a condition or two, and if there is a UIImagePickerControllerSourceTypeSavedPhotosAlbum , just set it to sourceType. Otherwise, if a UIImagePickerControllerSourceTypeCamera exists, set it to sourceType.
Also, I think [picker setShowsCameraControls: YES]; should be performed only for the source type UIImagePickerControllerSourceTypeCamera.
The error you get means that UIImagePickerControllerSourceTypeSavedPhotosAlbum not supported, so try to do it this way.
source share