2

でビデオを再生するビューコントローラがありますviewDidLoad。ビデオが終了したことを確認するオブザーバーがあり、ビデオが終了したことを検出すると、ViewControllerをスタックにプッシュするメソッドが呼び出されます。ただし、このメソッドを呼び出すと、コンソールで次のエラーが発生します。

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSPathStore2 setView:]: unrecognized selector sent to instance 0xc6ef8e0'

私が使用するコードを以下に示します。

....
....
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(advanceToNextView) name:MPMoviePlayerPlaybackDidFinishNotification object:player];  
....
....
- (void) advanceToNextView {

    UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"spoonVC"];


    [self.navigationController pushViewController:controller animated:NO];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.navigationController.view cache:NO];
    [UIView commitAnimations];

}

何が間違っているのかわかりません。ストーリーボード識別子が正しいことを確認して再確認しました。

4

2 に答える 2

3

このコードを置き換えます:

[self.navigationController pushViewController:controller animated:NO];

に:

 [self.navigationController pushViewController:controller animated:YES];
于 2012-09-11T06:43:52.930 に答える
0

それは解決策を見つけました。トランジションアニメーションを作成する方法は一貫していないようですが、以下は私にとってはうまくいくようです。

UIViewController *controller = [self.storyboard instantiateViewControllerWithIdentifier:@"page2"];
    [UIView beginAnimations:@"Flip transition" context:nil];
    [UIView setAnimationDuration:0.80];
    [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
    [UIView setAnimationTransition:
     UIViewAnimationTransitionCurlDown
                           forView:self.navigationController.view cache:NO];
    [self.navigationController pushViewController:controller animated:YES];
    [UIView commitAnimations];
于 2012-09-09T09:47:46.947 に答える