How to detect orientation, if screen is locked in portrait mode?
<p>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.</p>

<pre><code>- (UIInterfaceOrientationMask) supportedInterfaceOrientations {
    [super supportedInterfaceOrientations];
    return UIInterfaceOrientationMaskPortrait;
}
</code></pre>

<p>I'm using this below method to detect orientation but this will not called. </p>

<pre><code>- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation
{
    UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
    if (orientation == UIInterfaceOrientationPortrait || orientation == UIInterfaceOrientationPortraitUpsideDown)
    {
        NSLog(@"UIInterfaceOrientationPortrait");
    }
    else
    {
        NSLog(@"UIInterfaceOrientationland");

    }
}
</code></pre>