1
我有这样的代码:为什么self.navigationController成为零?
ViewController2 *childView = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil];
[self.navigationController pushViewController:childView animated:YES];
我的第一行,self.navigationController具有值。
在第二行,它的值变为0.为什么?
它没有区别。有一点需要注意的是,我正在使用基于视图的应用程序,而不是基于导航的应用程序。 – 2010-09-18 03:29:55
如果视图控制器的代码是其中一部分的视图控制器不在UINavigationController的堆栈上,那么'navigationController'属性始终为零(除了具有非常严重的内存垃圾错误的程序之外)。 – imaginaryboy 2010-09-18 03:41:37