I am using Xcode 4.2 to develop a storyboard application.
I am trying to rotate views but it is not working. I made sure that the app supports the 4 rotations in the summary as well as in the “info” section.
I have two types of supported orientations:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
if (UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPad) { //check if device is iPad
return YES;
}
else
return NO;
}
and
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
I tried it on the iPhone simulator and it is not working, but for the iPad it works perfectly fine… any reasons?
I am using a Tab Bar view controller if this makes any difference …
from this document
so make sure all view controller in your tab bar controller return
YESforshouldAutorotateToInterfaceOrientation: