I have a view controller which plays a video in viewDidLoad. I have an observer that checks to see when the video is finished and when it detects that the video is finished a method is called which pushes a view controller on to the stack. When this method is called, however, a get the following error in the console:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSPathStore2 setView:]: unrecognized selector sent to instance 0xc6ef8e0'
The code i use is shown below:
....
....
[[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];
}
I don’t know what i’m doing wrong. I have checked and double-checked the storyboard identifier is correct.
It found a solution. The way to produce transition animations doesn’t seem to be consistent but the following seems to work well for me.