0

我正在尝试在情节提要中以编程方式呈现视图控制器,我正在使用下面提到的代码,但它不起作用,没有给我任何回应......

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

我在这里想念什么?

4

1 回答 1

0
NSLog(@"called");

    UIStoryboard *sb = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];

    UINavigationController *vc = [sb instantiateInitialViewController];

    vc.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentViewController:vc animated:YES completion:nil];
于 2013-04-25T06:29:01.893 回答