0

How to change orientation programmatically. when button action is performed? I tried below code but is showing some error called "no visible interface for uidevice declares the selector setorientation"

my code is

       if (UIDeviceOrientationIsLandscape([UIDevice currentDevice].orientation))
 {
    // code for landscape orientation
    // OR
   //        [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeRight];
    //        //  OR
 /  /        [[UIDevice currentDevice] setOrientation:UIInterfaceOrientationLandscapeLeft];

}
Cœur
  • 37,241
  • 25
  • 195
  • 267
user2230971
  • 287
  • 1
  • 7
  • 22
  • I think you should take a look at [this](http://stackoverflow.com/a/12650730/1011213) – codeqi Apr 05 '13 at 12:42
  • http://stackoverflow.com/questions/12650137/how-to-change-the-device-orientation-programmatically-in-ios-6/12650730#12650730 – iPatel Apr 05 '13 at 12:58

0 Answers0