I think you are not checking the source type.
You might be doing
self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
If this is the case, then you have to check the source type before assigning it directly.
like
if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypePhotoLibrary])
{
// Set source to the Photo Library
self.sourceType =UIImagePickerControllerSourceTypePhotoLibrary;
}
I hope it helps