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中