我目前正在编写一个tvOS应用程序。我一直在使用tapRecognizer检测并覆盖菜单按钮,以在不同的故事板和其他功能之间切换。我的问题是,当我在主屏幕上按菜单时,它不会退出应用程序。相反,它会记住我上次覆盖菜单按钮时使用的最后一个功能,并执行该功能。有没有想过如何清除tapRecognizer?或者有没有一个函数可以退出应用程序?
我正在Storyboard1中覆盖菜单按钮。
tapRecognizer = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(home)];
tapRecognizer.allowedPressTypes = @[[NSNumber numberWithInteger:UIPressTypeMenu]];
[self.view addGestureRecognizer:tapRecognizer];
在我的主页子程序中,我将用户发送回我的主页故事板。但从那时起,菜单按钮将不会退出应用程序,而是将我发送回故事板1。 谢谢, SW