Ios 我的应用程序仅在iPad上以横向模式运行,但图像选择器抛出以下错误

Ios 我的应用程序仅在iPad上以横向模式运行,但图像选择器抛出以下错误,ios,ipad,Ios,Ipad,DriverWorkDiary[2564:60b]*由于未捕获的异常“UIApplicationInvalidInterfaceOrientation”而终止应用程序,原因是:“受支持的方向与应用程序没有共同的方向,并且shouldAutorotate返回YES” *第一次抛出调用堆栈: (0x2ff30fd3 0x3aaf8ccf 0x2ff30f15 0x327be4fb 0x327c5b05 0x327c5ab9 0x327c4bf9 0x3274c729 0x3274c507 0x327

DriverWorkDiary[2564:60b]*由于未捕获的异常“UIApplicationInvalidInterfaceOrientation”而终止应用程序,原因是:“受支持的方向与应用程序没有共同的方向,并且shouldAutorotate返回YES” *第一次抛出调用堆栈: (0x2ff30fd3 0x3aaf8ccf 0x2ff30f15 0x327be4fb 0x327c5b05 0x327c5ab9 0x327c4bf9 0x3274c729 0x3274c507 0x3274be71 0x3274bcc5 0x32758a6f 0x327584df 0x32803ccf 0x32803aeb 0x327fb995 0x327fae1d 0x327fab25 0x3274cd79 0x323ca62b 0x323c5e3b 0x323c56df 0x323c56df 0x323CFC22FEC22FEF9F4DF 0x329B 0x327CF8A 0x324DF663 0x327b016d 0xf7ca5 0x3b005ab7) libc++abi.dylib:以NSException类型的未捕获异常终止

这是我的代码:

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
    UIImagePickerController *picker;
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        picker = [[UIImagePickerController alloc] init];
        picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentViewController:picker animated:YES completion:NULL];
    }    
} else {
    UIImagePickerController *picker;
    if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
        picker = [[UIImagePickerController alloc] init];
        picker.delegate = self;
        picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;

        [self presentViewController:picker animated:YES completion:NULL];
    }
}

你在用iOS 6吗?如果是,则其副本为:可能的副本为