在Apple代码项目:MoviePlayer中,我想知道,当示例应用程序启动时,本地视频将立即以编程方式播放。
我加上最后两句:
[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‘
帮帮忙,谢谢!
发布于 2012-05-23 06:09:00
您需要得到指向您的MyLocalMovieViewController的指针,只需执行以下操作
[pointer playMovieButtonPressed:nil]https://stackoverflow.com/questions/10698550
复制相似问题