1

我是一个新程序员,我遇到了一个问题。当 liveLeft 达到 0 时,我只想从 ViewController 转换到 NOViewController。

(当你死了,“死亡”屏幕应该出现) 提前非常感谢!

if (livesLeft == 0)
{
    //transit to NOViewController

}
4

3 回答 3

0

你是这个意思吗?

NOViewController *secondView = [self.storyboard instantiateViewControllerWithIdentifier:@"storyboard_identifier"];

[self.navigationController pushViewController:secondView animated:YES];
于 2015-01-05T14:02:18.000 回答
0

是啊有点!我真的是一个新手,所以还没有了解导航控制器。但这解决了我的问题:

{
     NOViewController *NOVC = [[NOViewController alloc]init];
    [self presentViewController:NOVC animated:YES completion:^{

    }];

非常感谢您的回复!

于 2015-01-05T14:10:29.367 回答
0
if (livesLeft == 0)
{
    NOViewController *NoLivesVC = [[UIStoryBoard storyboardWithName: @"Main" setBundle: nil] instantiateViewConrollerWithIdentifier: @"ViewControllerIndentifier"];
    // Do something
    [self presentViewController animated: YES completion:nil];

}

希望这可以帮助。我想这就是你要问的。

于 2015-01-05T14:14:15.587 回答