调用 presentModalViewController
和 pushViewController
有什么区别,当:
What is the difference beetween calling presentModalViewController
and pushViewController
, when :
这只是为了能够从第一个推送视图返回吗?呜呜呜……
Is this just to be able to go back from the first pushed view ? Woooaaaaaa.....
我想区别在别处和更深的地方.没有?
I guess the difference is elsewhere and deeper. No ?
最重要的区别在于语义.模态视图控制器通常指示用户必须提供一些信息或做某事.此链接更深入地解释它:http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html
The most important difference is about semantics. Modal view controllers typically indicate that the user has to provide some information or do something. This link explains it more in depth: http://developer.apple.com/library/ios/#featuredarticles/ViewControllerPGforiPhoneOS/ModalViewControllers/ModalViewControllers.html
这是他们谈论的另一个不太抽象的区别:
Here's another, less abstract difference they talk about:
"当你呈现一个模态视图控制器时,系统会在执行呈现的视图控制器和被呈现的视图控制器之间创建父子关系.具体来说,执行呈现的视图控制器将其 modalViewController 属性更新为指向其呈现的(子)视图控制器.类似地,呈现的视图控制器更新其 parentViewController 属性以指向呈现它的视图控制器."
"When you present a modal view controller, the system creates a parent-child relationship between the view controller that did the presenting and the view controller that was presented. Specifically, the view controller that did the presenting updates its modalViewController property to point to its presented (child) view controller. Similarly, the presented view controller updates its parentViewController property to point back to the view controller that presented it."
另请参阅此主题:为什么要呈现模态视图控制器"?
这篇关于iOS - pushViewController 与 presentModalViewController 的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!