继续研究视频

早上好,今天继续研究视频播放。

  if ([[UIDevice currentDevice] respondsToSelector:@selector(setOrientation:)]) {
                SEL selector             = NSSelectorFromString(@"setOrientation:");
                NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:[UIDevice instanceMethodSignatureForSelector:selector]];
                [invocation setSelector:selector];
                [invocation setTarget:[UIDevice currentDevice]];
                int val                  = UIDeviceOrientationLandscapeRight;
                // 从2开始是因为0 1 两个参数已经被selector和target占用
                [invocation setArgument:&val atIndex:2];
                [invocation invoke];
            }

你可能感兴趣的:(继续研究视频)