在iOS 8中输入视频时旋转

在iOS 8中输入视频时旋转,ios,objective-c,ios8,nsnotificationcenter,Ios,Objective C,Ios8,Nsnotificationcenter,我在iOS 7中实现了这段代码,并且工作得很好,但在iOS 8中它不工作 [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil]; [[NSNotificationCenter defaultCenter] addObserv

我在iOS 7中实现了这段代码,并且工作得很好,但在iOS 8中它不工作

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerWillExitFullscreenNotification" object:nil];

-(void)youTubeStarted{
    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    appDelegate.fullScreenVideoIsPlaying = YES;
}

-(void)youTubeFinished{
    AppDelegate *appDelegate = (AppDelegate*)[[UIApplication sharedApplication] delegate];
    appDelegate.fullScreenVideoIsPlaying = NO;
}
我已尝试将UIMoviePlayerController标识符FullScreenNotification更改为MPMoviePlayerWirelerFullScreenNotification。不走运

还有别的办法吗

编辑

看看我认为iOS 8.1会发生什么,使用NorthBlast的答案。它与iOS 8.0和iOS 8.0.2完美配合


好的,这是一个解决方案,我现在正在使用。。我首先检查运行该设备的操作系统,然后使用相应的NSNotificationCenter:)


我希望有帮助

如果你能找到答案/解决方案,请告诉我。。我完全同意problem@NorthBlast你找到解决办法了吗?还是有同样的问题耶,我有,但不是为了退出。。我有一个可以作为出口的。。我会发布的..我想你现在遇到的问题是布局问题,而不是通知问题,但我今晚会检查..我遇到了与@ElioMB相同的错误,我们能在这里做什么?我尝试过了,它工作正常!但是如何锁定其他viewcontroller的方向
#define IS_OS_6_OR_LATER    ([[[UIDevice currentDevice] systemVersion] floatValue] >= 6.0)
#define IS_OS_8_OR_LATER    ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0)

if(IS_OS_6_OR_LATER){

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:@"UIMoviePlayerControllerDidEnterFullscreenNotification" object:nil];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:@"UIMoviePlayerControllerWillExitFullscreenNotification" object:nil];

}

if (IS_OS_8_OR_LATER) {

    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeStarted:) name:UIWindowDidBecomeVisibleNotification object:self.view.window];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(youTubeFinished:) name:UIWindowDidBecomeHiddenNotification object:self.view.window];

}