I have a detail view where i load a help view with a button. I am using [UIViewController presentModalViewController:animated:].
In help view I am dismissing the view with a button. I am using [UIViewController dismissModalViewControllerAnimated:].
The problem is, after dismissing the help view, the detail view is in portrait mode, regardless of which orientation the device is in.
In all the view controllers, I have implemented shouldAutoRotateToInterfaceOrientation: and returned YES.
I think there are two selective solution
1.Officially available in iOS 5.0 and later, you can implement
See also : http://developer.apple.com/library/ios/#DOCUMENTATION/UIKit/Reference/UIViewController_Class/Reference/Reference.html
2.Use the trick from Canopus’s Answer. It’s pretty fine with iOS 4.3 and earlier BUT It’s not guarantee solution that owner answer has warned you.
Hope it helps you!