iPad上的iOS6 UIImagePickerController问题

时间:2013-10-29 16:04:37

标签: ios ipad ios6 uiimagepickercontroller

我的应用程序使用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];
}

1 个答案:

答案 0 :(得分:0)

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