我正在开发一个iPhone应用程序,在其中我使用presentModalViewController方法将ViewController更改为最多2/3级(例如Home-->Option-->Other-->More)。
现在我想让我的应用程序返回到第一个屏幕或 ViewController。如果我使用missModalViewControllerAnimated方法,它只会关闭当前的 View Controller 。但我想清除堆栈并再次启动主屏幕。
感谢您的帮助。
最佳答案
为每个级别正确设置代表。因此,如果您在 More 中按 Cancel 或 Done,它将调用类似 [other moreViewDidCancel]
的内容,其中您将调用 dismissModalViewController:Animated:
并通知其父 View Controller (委托(delegate))应该解雇(so,[option otherViewDidCancel]
)等等直到顶层。
关于iphone - iOS Dismis 的 ViewController 堆栈,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8970382/