最簡單的方法:
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIInterfaceOrientationLandscapeRight] forKey:@"orientation"];
這篇帖子區分了三種情況:包含nav,包含tabBar,自身爲單獨的viewcontroller。http://www.jianshu.com/p/650ba0ff626b
http://www.jianshu.com/p/4a51a2edf270(含圖)
http://www.jianshu.com/p/5f5d46e674a7
http://blog.csdn.net/shly1988/article/details/46776691
http://www.jianshu.com/p/d8018006f0b5
http://blog.csdn.net/zhenyu5211314/article/details/24003809