Search code examples
iphoneuiimagepickercontroller

UIImagePickerController exception : "Source type must be UIImagePickerControllerSourceTypeCamera"


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!


Solution

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