【发布时间】:2011-09-19 02:09:21
【问题描述】:
好的 - 我的大脑此刻正在被烧毁,所以任何帮助都将不胜感激。
我的应用中有多个UIViewController 的子类。让我们打电话给他们VC_A, VC_B, VC_C, VC_D。
用户通过触摸每个视图上的按钮进行交互。
所以我的 AppDelegate 在 VC_A 中添加:
//Add the view controller's view to the window and display.
[self.window addSubview:viewController.view];
[self.window makeKeyAndVisible];
VC_A 然后使用presentModalViewController 加载VC_B:
VC_B *tempView = [[VC_B alloc] initWithNibName:@"temploadingscreen" bundle:nil];
[self presentModalViewController:tempView animated:NO];
[tempView release];
直到我得到 p> 的层次结构
VC_A
- VC_B
- VC_C
- VC_D
但是当我在 VC_D 上调用 presentModalViewController 将我带到 VC_C 时,我希望它是 VC_C 的新实例,而不是原始实例。
所以我的问题是你如何去做 - 我需要使用[self dismissModalViewControllerAnimated:NO]; 来删除视图的旧实例。
任何帮助将不胜感激,因为我已经对此进行了搜索,但所有教程和东西都使用导航栏来控制导航 - 由于应用程序的类型,我不能使用导航栏。在 UIViewControllers 的新实例之间正确移动的任何工作代码示例都会很棒。
【问题讨论】:
标签: iphone objective-c uiviewcontroller hierarchy presentmodalviewcontroller