我是一个新程序员,我遇到了一个问题。当 liveLeft 达到 0 时,我只想从 ViewController 转换到 NOViewController。
(当你死了,“死亡”屏幕应该出现) 提前非常感谢!
if (livesLeft == 0)
{
//transit to NOViewController
}
我是一个新程序员,我遇到了一个问题。当 liveLeft 达到 0 时,我只想从 ViewController 转换到 NOViewController。
(当你死了,“死亡”屏幕应该出现) 提前非常感谢!
if (livesLeft == 0)
{
//transit to NOViewController
}
你是这个意思吗?
NOViewController *secondView = [self.storyboard instantiateViewControllerWithIdentifier:@"storyboard_identifier"];
[self.navigationController pushViewController:secondView animated:YES];
是啊有点!我真的是一个新手,所以还没有了解导航控制器。但这解决了我的问题:
{
NOViewController *NOVC = [[NOViewController alloc]init];
[self presentViewController:NOVC animated:YES completion:^{
}];
非常感谢您的回复!
if (livesLeft == 0)
{
NOViewController *NoLivesVC = [[UIStoryBoard storyboardWithName: @"Main" setBundle: nil] instantiateViewConrollerWithIdentifier: @"ViewControllerIndentifier"];
// Do something
[self presentViewController animated: YES completion:nil];
}
希望这可以帮助。我想这就是你要问的。