0

I wanted to be able to enter a view controller only if an entered password is correct. i used the following code -

 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];

}

but when i enter , Xcode gave me a sigbrt error, so i added an all exception breakpoint, but it goes to main.m and says 'thread 1:break point 1.1'.

thank you for reading and if you know the answer please answer

CW0007007
  • 5,681
  • 4
  • 26
  • 31

1 Answers1

1
SecondViewController *second=[self.storyboard instantiateViewControllerWithIdentifier:@"storyboardid"];
[self.navigationController presentViewController:second animated:YES completion:nil];
sanjeet
  • 1,539
  • 15
  • 37