Iphone UIModalPresentationFormSheet不适用于iOS7中的UIImagePickerController(用于相机)

Iphone UIModalPresentationFormSheet不适用于iOS7中的UIImagePickerController(用于相机),iphone,objective-c,xcode,ios6,ios7,Iphone,Objective C,Xcode,Ios6,Ios7,我正在使用一个需要在iOS6和iOS7上都支持的应用程序 UIModalPresentationFormSheet(modalPresentationStyle)在iOS7中不适用于UIImagePickerController(用于相机),但在iOS6中工作正常 我该怎么办?根据,它应该显示在popover中。如果你不能适应这种情况,你可能不得不自己动手,或者使用开源软件。你可以使用下面的代码从ipad和iphone的照相机或多媒体资料中获取图像。与ipad一样,您无法使用presentmod

我正在使用一个需要在iOS6和iOS7上都支持的应用程序
UIModalPresentationFormSheet
modalPresentationStyle
)在iOS7中不适用于
UIImagePickerController
(用于相机),但在iOS6中工作正常


我该怎么办?

根据,它应该显示在popover中。如果你不能适应这种情况,你可能不得不自己动手,或者使用开源软件。

你可以使用下面的代码从ipad和iphone的照相机或多媒体资料中获取图像。与ipad一样,您无法使用presentmodalviewcontroller获取图像

if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) {
    UIPopoverController *popover = [[UIPopoverController alloc] initWithContentViewController:picker];
    [popover presentPopoverFromRect:self.selectedImageView.bounds inView:self.selectedImageView permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
    self.popOver = popover;
} else {
     [self presentViewController:picker animated:YES completion:nil];
}

进行此更改时,您是否收到任何类型的错误消息或编译器错误?