Question

I have an application on AppStore that has portrait Mode on iPhone and on iPad it works on landscape. However i am getting reports that it shows portrait on iPad 1 thus destroyed overall View.

Why is iPad 1 specifically showing Portrait mode? The version of iPad is 5.1.1

Was it helpful?

Solution

In ios 6, the methods for supporting interface orientation has been changed. For supporting both interface orientation in both version, we need to check the os version and write code acoordingly.

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
return (interfaceOrientation == UIInterfaceOrientationPortrait); 
}

Support for new versions

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotate {
   }

In my View Controller i have the following:

- (NSUInteger)supportedInterfaceOrientations {

}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation {

}

- (BOOL)shouldAutorotate {

} 

OTHER TIPS

Go and make sure ALL view controllers return the correct orientation modes they support. I've seen such behaviour in iOS 5 and if I recall correctly that was the reason.

I had a very similar from and I resolved it by changing the following code in AppDelegate.m-> applicationDidFinishLaunching:

 [self.window addSubview:self.viewController];

to

 [self.window setRootViewController:self.viewController];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top