如何在任何类的viewDidLoad
方法中为下一个类添加navigationcontroller,我还没有在appdelegate的开头添加它。
答案 0 :(得分:2)
YourViewController *report = [[YourViewController alloc] init]; // create Object of YourViewController
UINavigationController *navigationController = [[UINavigationController alloc]initWithRootViewController:report]; // add YourViewController as root view controller of UINavigationController
[self presentModalViewController:navigationController animated:YES];