iOS6 and shouldAutorotateToInterfaceOrientation


#1

In the documentation there is a hint for IOS6:

So in iOS6 the rotation cannot handle by these method.
Are there any other suggestions, or workarounds available?
Or does anyone know how to get the cached information?

best regards
Christian


#2

As iOS 6 is not out yet, it is likely that that quote is under NDA, which means you would be wise to delete that post and ask in the Apple Dev forums.
Honestly though, I don’t know the answer.


#3

I took the this entire code out:

[code]-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)io
{
if ([[UIDevice currentDevice] userInterfaceIdiom]==UIUserInterfaceIdiomPad)
{
return YES;
}

    else
    {
        return NO;
    }

[/code]

and

Under project summary, “Supported Interface Orientations” for the iPhone/iPod I set it to portrait. However, for iPad (below the iPhone Deployment info), I selected Portrait, Landscape Left, and Landscape Right, and that seems to work fine.


#4

Since iOs 7 is officially out, "shouldAutorotateToInterfaceOrientation: " is officially deprecated.
Documentation states that instead of that method we should “Override the “supportedInterfaceOrientations” and “preferredInterfaceOrientationForPresentation” methods instead.”

However, those two method return objects of completely different types: NSUInteger and UIInterfaceOrientation respectively.

In the book we are given following code that we include in the ItemsViewController.m and DetailViewController.m:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)io { if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad) { return YES; } else { return (io == UIInterfaceOrientationPortrait); } }

Can anyone help out and provide new code adjusted for iOS6 ?
Appreciate your time.