0

我希望只有在输入的密码正确时才能进入视图控制器。我使用了以下代码 -

 if(([input isEqual:@"12"]))
{
    NSLog(@"change view controller");
    NSString * storyboardName = @"Main";
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil];
    UIViewController * vc = [storyboard instantiateViewControllerWithIdentifier:@"secondViewController"];
    [self presentViewController:vc animated:YES completion:nil];

}

但是当我输入时,Xcode 给了我一个 sigbrt 错误,所以我添加了一个所有异常断点,但它转到 main.m 并显示“线程 1:断点 1.1”。

感谢您的阅读,如果您知道答案,请回答

4

1 回答 1

1
SecondViewController *second=[self.storyboard instantiateViewControllerWithIdentifier:@"storyboardid"];
[self.navigationController presentViewController:second animated:YES completion:nil];
于 2014-09-03T10:02:03.233 回答