【发布时间】:2013-10-21 06:20:21
【问题描述】:
当我在 iPhone 上使用 UIImagePicker 时,应用程序崩溃了,但仅限于 iOS 7。
我使用以下代码行
picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
if( [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceFront] || [UIImagePickerController isCameraDeviceAvailable:UIImagePickerControllerCameraDeviceRear])
{
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
} else {
//[self showAlertViewWithTitle:@"Sorry" message:@"Your Device Don't Have Camera"];
}
[self presentViewController:picker animated:YES completion:nil];
}
该应用在 iOS 6 上运行,而不是在 iOS 7 上运行。 我是这个网站的新手,请帮忙。
【问题讨论】:
-
你能发布你得到的异常吗?
-
说清楚。在
iOS 7下运行并在iOS 6下运行时崩溃?是的,最好的方法是也从控制台发布错误消息等。 -
原因:'支持的方向与应用程序没有共同的方向,并且 shouldAutorotate 正在返回 YES'
-
然后在您的 ViewController 中将 shouldAutorotate 更改为 NO 而不是 YES。
-
试过但没有运气。应用程序在 iOS6 中运行,而不是在 iOS 7 中。
标签: ios ios7 uiimagepickercontroller