UIInterfaceOrientation is "0" (Zero) when MPMoviePlayerController is dismissed
I've got a simple application displaying a fullscreen video via Apple's MPMoviePlayerController calling presentModalViewController on the rootViewController of the AppDelegate. If I start the video in Landscape and dismiss it within the moviePlaybackDidFinish Method I always end up in Portrait Mode.

Problem is: I want to hide a view that's only visible in Landscape Mode with a simple check in the willAnimateRotationToInterfaceOrientation method of my UIViewController (see below). However I noticed, that the orientation isn't a valid value, as it always 0 (!) when the MPMoviePlayerController is dismissed.

Anybody has a clue, why and how to fix it?

    - (void) willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation duration:NSTimeInterval) duration
    {
      if (UIInterfaceOrienationIsPortrait(toInterfaceOrienation))
      {
          // Should enter here
          self.myView.hidden = YES;
      }
      else
      {
         // Always end up here, when toInterfaceOrienation is 0 (Zero)
         self.myView.hidden = NO;
      }
    }

Due to the fact, that toInterfaceOrienation is 0, this call always ends up in the second part, although the application is visually in Portrait Mode.
UIInterfaceOrientation is "0" (Zero) when MPMoviePlayerController is dismissed
===

I've got a simple application displaying a fullscreen video via Apple's MPMoviePlayerController calling presentModalViewController on the rootViewController of the AppDelegate. If I start the video in Landscape and dismiss it within the moviePlaybackDidFinish Method I always end up in Portrait Mode.

Problem is: I want to hide a view that's only visible in Landscape Mode with a simple check in the willAnimateRotationToInterfaceOrientation method of my UIViewController (see below). However I noticed, that the orientation isn't a valid value, as it always 0 (!) when the MPMoviePlayerController is dismissed.

Anybody has a clue, why and how to fix it?

    - (void) willAnimateRotationToInterfaceOrientation: (UIInterfaceOrientation)toInterfaceOrientation duration:NSTimeInterval) duration
    {
      if (UIInterfaceOrienationIsPortrait(toInterfaceOrienation))
      {
          // Should enter here
          self.myView.hidden = YES;
      }
      else
      {
         // Always end up here, when toInterfaceOrienation is 0 (Zero)
         self.myView.hidden = NO;
      }
    }

Due to the fact, that toInterfaceOrienation is 0, this call always ends up in the second part, although the application is visually in Portrait Mode.