Possible Duplicate:
Problem pushViewController from Landscape to Portrait
In my app some of the view controller supports both landscape and portrait, while some supports only portrait.
I have 3 view controllers FirstVC, SecondVC and ThirdVC. I want :
- FirstVC and ThirdVC supports both landscape and Portrait
- SecondVC should support only portrait.
For that I :
- override
shouldAutorotateToInterfaceOrientationin all View Controller - return
UIInterfaceOrientationIsPortrait(interfaceOrientation);in SecondVC - returned YES in other two.
When I push SecondVC from FirstVC (in landscape mode), my SecondView is not shifting to portrait, it remains in landscape. But when I rotate SecondVC to portrait, it view rotate accordingly and again when I rotate, this time it remain in portrait does not change to landscape.
I hope I am clear.
Please can anyone know where I am doing wrong? Thanks in advance!
Have a look a this post Problem pushViewController from Landscape to Portrait
You have to present the VC Modally.