我正在尝试以编程方式在storyboard中呈现viewcontroller,我正在使用下面提到的代码,但它不起作用,不给我任何回复......
- (void)buttonPressed
{
NSLog(@"called");
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];
UINavigationController *vc = [sb instantiateViewControllerWithIdentifier:@"123"];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self.navigationController presentModalViewController:vc animated:YES];
}
我在这里缺少什么?
答案 0 :(得分:0)
NSLog(@"called");
UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
UINavigationController *vc = [sb instantiateInitialViewController];
vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentViewController:vc animated:YES completion:nil];