2

如何在viewDidLoad任何类的方法中为他们的下一个类添加导航控制器,我没有在 appdelegate 的开头添加它。

4

1 回答 1

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];
于 2013-03-29T05:56:30.580 回答