In Apple sample code project: MoviePlayer
, I want to realize that, when the sample App starts, the local video is played immediately programmatically.
I add the last 2 sentences:
[self.tabBarController setSelectedIndex:1];
[self performSelector:@selector(playMovieButtonPressed:) withObject:tabBarController.selectedViewController afterDelay:0.0];
in the function below:
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
/* Override point for customization after app. launch. */
/* Add the tab bar controller's current view as a subview of the window. */
[window addSubview:tabBarController.view];
[window makeKeyAndVisible];
[self.tabBarController setSelectedIndex:1];
[self performSelector:@selector(playMovieButtonPressed:) withObject:tabBarController.selectedViewController afterDelay:0.0];
}
but get the following error:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MyLocalMovieViewController playMovieButtonPressed]: unrecognized selector sent to instance 0x6190330'
Please help, thanks!