xcode 4.3.2如何以编程方式使用模态segue更改视图

时间:2012-11-07 09:17:16

标签: storyboard modal-dialog nstimer segue

嘿伙计们,我需要帮助,在这种情况下,我需要在4秒后使用模态segue转移到另一个视图..但是当我运行它所有它显示的是一个空白视图..有什么不对,我做了..即时通讯仍然是xcode的新手任何想法/建议真的很有帮助..谢谢这是我的代码..

-(void)onTimer
{
    mainInt += 1;
    if(mainInt == 4)
    {
        Game2ViewController *gameStart = [[Game2ViewController alloc] initWithNibName: @"Game2ViewController" bundle: nil];
        [self presentModalViewController: gameStart animated: YES];
    }
}

1 个答案:

答案 0 :(得分:0)

-(void)onTimer 
{ 
mainInt += 1; 
if(mainInt == 4) 
{ 
[self performSegueWithIdentifier:@"NextView" sender:self]; 
} 
} 
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender 
{ 
if ([segue.identifier isEqualToString:@"NextView"]) 
{ Game2ViewController *gameStart = [[Game2ViewController alloc] init]; } }