添加Nav方法:
在AppDelegate中
.h文件
@property (strong, nonatomic) UINavigationController *navC;
.m文件
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
添加方法2种如下:
1 、self.navC = [[[UINavigationControlleralloc] init] autorelease];
[self.navCpushViewController:self.viewControlleranimated:YES];
self.window.rootViewController = self.navC;
2、会有提示信息:
Application windows are expected to have a root view controller at the end of application launch
程序运行正常,尚未知道有何影响。
self.navC = [[UINavigationControlleralloc] initWithRootViewController:self.viewController];
[self.windowaddSubview:self.navC.view];