【发布时间】:2014-11-19 13:33:56
【问题描述】:
我在 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;
}
我尝试将 UIMoviePlayerControllerDidEnterFullscreenNotification 更改为 MPMoviePlayerWillEnterFullscreenNotification。没有运气
还有其他方法吗?
编辑
看看我对 iOS 8.1 的看法,使用 NorthBlast 的答案。它与 iOS 8.0 和 iOS 8.0.2 完美配合
【问题讨论】:
-
如果您找到答案/解决方案,请告诉我。我也有同样的问题
-
@NorthBlast 你找到解决方案了吗?还是有同样的问题
-
是的,我做了,但不是为 WillExit.. 我有一个可以作为 DidExit.. 我会发布它..
-
我认为您现在遇到的问题是布局问题而不是通知问题,但我今晚会检查它..
标签: ios objective-c ios8 nsnotificationcenter