IOS 6 strengthens the orientation

In iOS5, you can use this snippet to force orientation:

UIViewController *c = [[UIViewController alloc]init];
[self presentModalViewController:c animated:NO];
[self dismissModalViewControllerAnimated:NO];
[c release];

However, this calls EXC_BAD_ACCESS on iOS6. How can there be a certain orientation in iOS6?

+5
source share
3 answers

In case someone still cares about this, here is a snippet of iOS6 code (I put it in my viewDidLoad program):

UIViewController *viewController    = [[UIViewController alloc] init];
viewController.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:viewController animated:NO completion:^{
    [self dismissViewControllerAnimated:NO completion:nil];
}];
+2
source

To complete the previous answer, you must do the following:

UIViewController *viewController = [[UIViewController alloc] init];
[self presentViewController:viewController animated:NO completion:^{
    [viewController dismissModalViewControllerAnimated:NO];
}];

And iOS 6 is no longer under the NDA.

+7
source

presentModalViewController dismissModalViewControllerAnimated , , , iOS6 . .

-, [self dismissModalViewControllerAnimated:NO]; . ?

, iOS6 NDA

+1
source

All Articles