ios 强制改变某一页面屏幕方向


- (void)viewWillAppear:(BOOL)animated

{

    UIInterfaceOrientation* orientation  = UIInterfaceOrientationLandscapeLeft; // 屏幕方向参数

        SEL selector = NSSelectorFromString(@"setOrientation:");

        NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];

        [invocation setSelector:selector];

        [invocation setTarget:[UIDevice currentDevice]];

        int val = orientation;

        [invocation setArgument:&val atIndex:2];

        [invocation invoke];

}