1. 設(shè)置UIWindow的根視圖為導(dǎo)航控制器
//? CZAppDelegate.m
//? 03-UINav
//? Created by apple on 08/07/14.
//? Copyright (c) 2014年itcast. All rights reserved.
#import"CZAppDelegate.h"
#import"CZOneViewController.h"
@implementationCZAppDelegate
- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
{
self.window= [[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];
self.window.backgroundColor= [UIColorwhiteColor];
// 1.實例化導(dǎo)航控制器
CZOneViewController*one = [[CZOneViewControlleralloc]init];
UINavigationController*nav = [[UINavigationControlleralloc]initWithRootViewController:one];
nav.view.backgroundColor= [UIColorredColor];
NSLog(@"=== %@", nav);
self.window.rootViewController= nav;
[self.windowmakeKeyAndVisible];
returnYES;
}