iOS6关于iPad UIImagePickerController的问题

iOS6关于iPad UIImagePickerController的问题,ios,ipad,ios6,uiimagepickercontroller,Ios,Ipad,Ios6,Uiimagepickercontroller,我的应用程序使用UIImagePickerContoller,可以在iOS 7(iPad和iPhone)上正常工作,但只能在iOS 6的iPhone上工作。在装有iOS 6的iPad上,当我单击使用该类从照片库中选择图片的按钮时,它会在模拟器中崩溃,但在调试器日志中没有指明原因。我的应用程序仅限于纵向视图。代码如下: -(IBAction)selectPicturePressed:(id)sender { //Open a UIImagePickerController to selec

我的应用程序使用UIImagePickerContoller,可以在iOS 7(iPad和iPhone)上正常工作,但只能在iOS 6的iPhone上工作。在装有iOS 6的iPad上,当我单击使用该类从照片库中选择图片的按钮时,它会在模拟器中崩溃,但在调试器日志中没有指明原因。我的应用程序仅限于纵向视图。代码如下:

-(IBAction)selectPicturePressed:(id)sender
{
    //Open a UIImagePickerController to select the picture
    UIImagePickerController *imgPicker = [[UIImagePickerController alloc] init];
    imgPicker.delegate = self;
    imgPicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

    [self.navigationController presentViewController:imgPicker animated:YES  completion:nil];
}

当源类型为照片库时,UIImagePickerController必须在UIPopoverController中显示。

您为什么要从控制器的导航控制器而不是控制器显示选择器?@bachma0507我很高兴能提供帮助。