I have created an iphone app which is only in portrait orientation,even though i have made one view supporting landscape orientation also while rotating the device
Everything works fine in iOS6 but when i run it on iOS5,the landscape mode is not proper it shows some nasty images.
(both devices are ipod 3.5″ retina display)
Why is this happening??
Adding my codes and screen shots here
In iOS6


in iOS 5


-(void)viewDidLoad {
[super viewDidLoad];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(didRotate:)
name:UIDeviceOrientationDidChangeNotification
object:nil];
}
- (void)didRotate:(NSNotification *)notification {
UIDeviceOrientation orientation = [[notification object] orientation];
if (orientation == UIDeviceOrientationLandscapeLeft) {
[self.grpView setTransform:CGAffineTransformMakeRotation(M_PI / 2.0)];
imageScrollView.frame =CGRectMake(-50, -100, 400, 620);
} else if (orientation == UIDeviceOrientationLandscapeRight) {
[self.grpView setTransform:CGAffineTransformMakeRotation(M_PI / -2.0)];
} else if (orientation == UIDeviceOrientationPortraitUpsideDown) {
[self.grpView setTransform:CGAffineTransformMakeRotation(M_PI)];
} else if (orientation == UIDeviceOrientationPortrait) {
[self.grpView setTransform:CGAffineTransformMakeRotation(0.0)];
}
}
InterfaceOrientation method is got deprecated in ios6.
So that if you want your orientation supported by both ios5 & ios6, you have to write two extra methods for ios6 along with
Two extra methods for ios6
Enjoy Programming!