我正在使用ARC + Storyboard。
我没有使用segues或UINavigationController,而是使用以下方式展示每个单独的视图:
UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
SecondViewController *secondViewController = [storyBoard instantiateViewControllerWithIdentifier:@"SecondVC"];
[self presentViewController:secondViewController animated:YES completion:nil];
我的应用程序的典型流程是:
MainViewController
presentViewController:
SecondViewController
presentViewController:
ThirdViewController
...等等
在向前移动之后,我不希望之前呈现的视图控制器仍然停留在内存中。
目前,在进入第二个视图控制器后,我可以在MainViewController的定时器函数中设置一个断点,并验证所有内容是否仍然存在。