2

I have trouble in my app when it is run in iOS6.0. It works perfectly fine on iOS 5.1.1 and under but on the 6.0 shows exc_bad_access.

Please tell me why.

-(void)endAniView{

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

This method called when the user touches a button. What follows are the errors I see on iOS6 but not in previous iOS versions:

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)

Please help me.

Thanks

4

1 に答える 1

0

スーパー ビューから削除する代わりに、代わりに次のコードを使用してみてください。

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

これは、表示側のビュー コントローラーにビューを閉じるように指示します。removeFromSuperviewこれを自分で呼び出すと、メッセージが表示中のView Controllerに転送されるため、よりうまく機能します。

于 2012-09-25T10:45:26.210 に答える