2

I have to write an universal app, the iPhone part has only to be presented in Portrait so it would be the preferred orientation and it doesn't have to support other orientations, BUT I encountered the problem that adding a MPMoviePlayerController inside a modally presented controller it's ability have to rotate in Landscape.

For this if I block only in portrait the supported interface orientations in the app settings and in that controller I do:

- (BOOL) shouldAutorotate
{
    return YES;
}

- (NSUInteger)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskLandscapeRight | UIInterfaceOrientationMaskLandscapeRight;
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeLeft;
}

the result is a 'preferredInterfaceOrientationForPresentation must return a supported interface orientation!' crash.

Otherwise if I have to set supported orientations Portrait and Landscape but everywhere block the preferred orientation and set shouldrotate to NO in every controller should work I suppose but it would be really a bad thing in my opinion.

How you will do with this kind of new interface orientation mechanism?

Thanks

jerrygdm
  • 450
  • 1
  • 7
  • 22

0 Answers0