UIImagePickerController exception : "Source type must be UIImagePickerControllerSourceTypeCamera"

Danail picture Danail · Sep 11, 2010 · Viewed 10.9k times · Source

what is wrong with this? I really don't understand some important parts for UIImagePickerController....

here's the source:

     UIImagePickerController *imagePickerController = [[UIImagePickerController alloc] init];
imagePickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
imagePickerController.cameraCaptureMode = UIImagePickerControllerCameraCaptureModePhoto;        
imagePickerController.delegate = self;
[self presentModalViewController:imagePickerController animated:YES];
[imagePickerController release];

Can't I open the photo library? Any help appreciated!

Answer

nevan king picture nevan king · Sep 11, 2010

If you're using the photo library, do you need to set cameraCaptureMode?