2012-09-18 106 views
2

当我的应用在iOS6.0中运行时遇到问题。它在iOS 5.1.1和6.0以下的版本中工作得非常好,并且在exc_bad_access之上。iOS 6.0上的MPMoviePlayerViewController崩溃

请告诉我为什么。

-(void)endAniView{ 

    if (moviePlayer!=nil) { 
     [moviePlayer.moviePlayer stop]; 
     [self removeFromSuperview]; 
    } 
} 

当用户触摸按钮时调用此方法。 接下来是在以前的IOS版本我在iOS6的看到了错误,但不是:

2012-09-18 16:13:22.410 KiKiSong[992:907] [MPAVController] Autoplay: Disabling autoplay for pause 
2012-09-18 16:13:22.411 KiKiSong[992:907] [MPAVController] Autoplay: Disabling autoplay 
2012-09-18 16:13:22.450 KiKiSong[992:907] [MPAVController] Autoplay: Skipping autoplay, disabled (for current item: 1, on player: 0) 

请帮助我。

谢谢

+0

在UIWebView中录制Vimeo视频后,我有完全相同的问题。编辑:我在运行iOS6的iPhone 4S上 –

回答

0

而不是从超级视图中删除它,请尝试使用下面的代码在它的位置。

[self.presentingViewController dismissViewControllerAnimated:YES completion:nil]; 

这告诉呈现视图控制器关闭视图。它比removeFromSuperview更好,因为如果你自己调用它,它会将消息转发给呈现视图控制器,这似乎是你的情况。