2010-02-02 103 views
0

我有一个项目,其中有根视图控制器和多个子视图控制器。子viewcontrollers多视图控制器的视图之间切换

在根的ViewController我打电话和开关2之间

代码为:

//root view controller controller button at front of all subviewcontrollers'view 

[vViewController2.view removeFromSuperview]; 
[self.view insertSubview:vViewController1.view atIndex:0]; 
在此模式下

子视图/在存储器中的ViewController将被卸载,当它被加载后,它会提示viewDidload的事件。

但我更喜欢子视图控制器被加载后,当开关,它存储在内存中,而不是从内存中卸载。

如果做了,因为这,我不得不increate atIndex的价值。

当我尝试返回到与atIndex的低值子视图 - 控制,我不knwo怎么办。

欢迎任何评论

感谢 InterDev中

回答

0

考虑使用标准的解决方案,即UINavigationControllerUITabBarController取决于你的观点的层次 - 这些标准类会做大量的工作适合你。

相关问题