Sorry if this question is duplicate, but I can\'t find the same solution. In iOS6, if I want to set default orientation for one UIViewController, I just use:
- (
- (BOOL)shouldAutorotate { UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation]; if (orientation==UIInterfaceOrientationPortrait) { // do some } return YES; }
Include both the methods to support both 5 and 6