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];
}