My application works in both orientation(portrait and landscape) but one of the screen is locked in portrait mode. But I have to set one value in Rotation variable for that particular screen. But I did not find orientation. So I want to find orientation. I'm using this below code for lock my screen in portrait mode and it will work.
- (UIInterfaceOrientationMask) supportedInterfaceOrientations {
[super supportedInterfaceOrientations];
return UIInterfaceOrientationMaskPortrait;
}
I'm using this below method to detect orientation but this will not called.
- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown)
{
NSLog(@"UIInterfaceOrientationPortrait");
}
else
{
NSLog(@"UIInterfaceOrientationland");
}
}