在 Apple 示例代码项目:MoviePlayer
中,我想实现,当示例 App 启动时,本地视频会立即以编程方式播放。
我添加最后两句话:
[self.tabBarController setSelectedIndex:1];
[self performSelector:@selector(playMovieButtonPressed:) withObject:tabBarController.selectedViewController afterDelay:0.0];
在下面的函数中:
- (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];
}
但得到以下错误:
由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[MyLocalMovieViewController playMovieButtonPressed]:无法识别的选择器发送到实例 0x6190330”
请帮忙,谢谢!