- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
myView = [[ViewController alloc ]init];
// Override point for customization after application launch.
UInavigation * navigation = [[UINavigationController alloc]initWithRootViewController:myView];
self.window.backgroundColor = [UIColor whiteColor];
[self.window addSubview:navigation.view];
[self.window makeKeyAndVisible];
return YES;
}
若如上进行页面初始化,后续页面中如果打出NSLog(@"%@",self.navigationController );将会为空;
如果上面先将navigation变量定义在.m文件中就不会出现这种情况;