0

I have a problem here and am not able to come up with answer why my app is behaving so. I made application using XCode 4.5+ and iOS6 and have set my application to work in landscape mode it was working and running fine till I tried to run it in previous version like iOS 5.1 simulator or below all views are in portrait mode :(

AMIC MING
  • 6,306
  • 6
  • 46
  • 62
Just Variable
  • 892
  • 10
  • 19
  • 1
    for iOS5 you have to implement the method `- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation` in your view controllers – tkanzakic Jan 15 '13 at 15:08
  • Please search first, there are many similar posts regarding orientation changes in iOS 6.0, like [this](http://stackoverflow.com/questions/12404556/interface-orientation-in-ios-6-0). – phi Jan 15 '13 at 15:12
  • @Irene my app is working well in iOS 6 but I am not able to understand the reason why my app is in portrait mode in Lower versions whereas in landscape mode in iOS6, when I have set entire application to landscape mode(I have set it to landscape from my xib files) and also in supported Interface orientation – Just Variable Jan 15 '13 at 15:22

2 Answers2

0

You can try defining this method in your controllers:

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

This plays the same role as shouldAutorotate for iOS6.

sergio
  • 68,819
  • 11
  • 102
  • 123
0

as suggested by tkanzakic - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOr‌​ientation solved my problem with lower versions thanks a lot :)

Just Variable
  • 892
  • 10
  • 19