2013-10-29 116 views
0

我的应用程序使用UIImagePickerContoller,它适用于iOS 7(iPad和iPhone),但仅适用于iOS 6的iPhone。在iOS 6的iPad上,当它点击按钮,该类使用此类从照片库中选择一张照片,但不表示调试器日志中的原因。我的应用仅限于纵向视图。代码如下:iPad上的iOS6 UIImagePickerController问题

-(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]; 
} 
+0

是否有任何理由说明您要从控制器的导航控制器而不是控制器中提出选取器? – Simon

回答

0

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

+0

谢谢!那样做了。 – bachma0507

+0

@ bachma0507我很高兴能帮到你。 – Steve