IPad Orientation check wrongly
<p>i am check device and interface orientation programetically but every time it goes to landscape Orientation even in portraite mode also
Here is my code please give me Solution:-</p>

<pre><code>if ([[UIDevice currentDevice]orientation] == UIDeviceOrientationLandscapeLeft||[[UIDevice currentDevice] orientation]== UIDeviceOrientationLandscapeRight || [self interfaceOrientation] == UIInterfaceOrientationLandscapeLeft || [self interfaceOrientation] == UIInterfaceOrientationLandscapeRight)
     {

     }
     else
     {


     }
</code></pre>
