我有一个视图控制器,它在viewDidLoad
. 我有一个观察者检查视频何时完成以及当它检测到视频完成时调用一个方法,该方法将视图控制器推入堆栈。但是,当调用此方法时,控制台中会出现以下错误:
*** 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];
}
我不知道我做错了什么。我已经检查并仔细检查了故事板标识符是否正确。