How to add navigation controller programmatically?

后端 未结 2 595
南旧
南旧 2021-01-03 08:12

I use code below, but it is not loaded:

UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@\"Main\" bundle:nil];
self.mapViewController = [storybo         


        
2条回答
  •  借酒劲吻你
    2021-01-03 08:55

    try as below

    UIViewController *bbp=[[UIViewController alloc]initWithNibName:@"UIViewController" bundle:nil];
    UINavigationController *passcodeNavigationController = [[UINavigationController alloc] initWithRootViewController:bbp];
    // [self.navigationController presentModalViewController:passcodeNavigationController animated:YES];
      [self.navigationController pushViewController:passcodeNavigationController animated:YES];
      [passcodeNavigationController release];
    

提交回复
热议问题