【发布时间】:2013-11-08 22:01:40
【问题描述】:
我的应用程序使用 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];
}
【问题讨论】:
-
您是否有任何理由从控制器的导航控制器而不是控制器中显示选择器?
标签: ios ipad ios6 uiimagepickercontroller