In iOS5.1 and previous versions, we typically use shouldautorotatetointerfaceorientation: to individually control the spin-screen orientation support for a uiviewcontroller-(BOOL) Shouldautorotatetointerfaceorientation: (uiinterfaceorientation) tointerfaceorientation{return Uiinterfaceorientationislandscape (tointerfaceorientation);} But in IOS6, this method is discarded and replaced by these two combinations:-(BOOL) shouldautorotate{return YES;}-(Nsuinteger) supportedinterfaceorientations {return uiinterfaceorientationmasklandscape;} -(uiinterfaceorientation) preferredinterfaceorientationforpresentation{return Uiinterfaceorientationlandscaperight;} If all view controllers in the entire application do not support spin screen-(Nsuinteger) Application: (UIApplication *) application Supportedinterfaceorientationsforwindow: (UIWindow *) window {return uiinterfaceorientationmaskportrait; }
iOS screen rotation