My application runs in only landscape mode ! so I know UIImagePickerController
presents only in portrait mode , so in iOS 6 , I had created a subclass of UIImagePickerController
that forced UIImagePickerController
to open in portrait mode:
@interface NonRotatingUIImagePickerController : UIImagePickerController
@end
@implementation NonRotatingUIImagePickerController
- (BOOL)shouldAutorotate {
return NO;
}
@end
//presenting picker controller :
UIImagePickerController *ipc = [[NonRotatingUIImagePickerController alloc]init];
ipc.delegate = self;
[self presentViewController:ipc animated:YES completion:nil];
This worked fine in iOS 6 , but now in iOS 7 my app does crash because of this :
2013-10-31 14:56:01.028 Medad[1731:60b] *** Terminating app due to
uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason:
'Supported orientations has no common orientation with the
application, and shouldAutorotate is returning YES'
This problem could be solved if I check Portrait
in deployment info :
The problem is if I check this option my app does run in portrait too but I don't want it!
How can I solve this issue?