views:

411

answers:

1

Hi everyone,

I've hit a bit of a roadblock with something that I hope that someone in here can help me out with. I'll describe the 'state of play' first, and then what the issue is, so here goes;

  1. I have a series of view controllers that are chained together with a Navigation Controller (this works just fine),
  2. All of these view controllers support portrait mode only (by design),
  3. In one of the view controllers (the 'end' one actually) the user can click a table cell to pop up a modal view controller (using presentModalViewController(...) of course)
  4. This modal view controller supports portrait and landscape modes (and this works),
  5. When the user clicks the 'Done' button on this modal view controller we pop and pass control back to the parent view controller, however;
    1. If the user is in portrait mode when they click 'Done' then the parent displays itself just fine,
    2. If the user is in landscape mode when they click 'Done' then the parent displays a totally white, blank screen (that covers the whole screen). It is as if the controller does not know how to render in landscape and just doesn't bother.

I'd like to be able to have this parent view render in portrait no matter what the orientation of the phone is when the user clicks the 'Done' button.

Various forum posts suggest using the UIDevice method 'setOrientation' (but this is undocumented and will get our app rejected apparently). Another suggestion was to set the 'statusBarOrientation' to portrait in the 'viewWillAppear' method but that had no effect.

So I am a bit stuck!

Has any encountered anything like this before? If need be I can provide code, if that will help anyone diagnose the problem for me.

Thanks in advance!

Cheers, Ben

A: 

i had the similar problem not long ago. app was rejected because of using setOrientation method. then i'd just disabled Done button in landscape mode. it seems that this is the easiest way.

Morion
Thanks for this answer. I have actually done exactly the same thing. It's not ideal though, is it?This seems like pretty fundamental stuff to a device such as the iPhone. There must be a solution to this problem...
Ben