"Multiple"和"Multiple"之间有什么区别?和“单"用于View Controller演示? [英] What is the difference between "Multiple" and "Single" for View Controller Presentation?

查看:55
本文介绍了"Multiple"和"Multiple"之间有什么区别?和“单"用于View Controller演示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用Xcode开发OS X应用程序.一个完全困扰我的选项是演示",两个选项单身"和多人"此属性的作用是什么?

I've been working on an OS X app in Xcode. An option that completely perplexes me is "Presentation", with the two options "Single" and "Multiple" what does this attribute do?

推荐答案

因此,一旦我使用它,这实际上是显而易见的".

So, this was actually "obvious" once I used it.

基本上,此功能会使一个窗口显示一次,或者如果情节提要中的相应脚本已被多次触发,则该窗口将显示多次.

Basically, this feature causes a window to be displayed once, or multiple times if the corresponding segue in a storyboard has been triggered multiple times.

要实际操作,请添加一个带有情节控制器的创建情节提要.在视图上放置一个按钮,以及一个附加的窗口控制器.在按钮和窗口控制器之间创建一个序列,以显示"窗口控制器.

To see this in action, add a create a storyboard with a view controller in it. The place a button on the view, and an additional window controller. Create a segue between the button and the window controller to "show" the window controller.

单击窗口控制器,然后在两个 Presentation 选项之间切换.运行它时,您会发现一个案例将创建该窗口的多个实例,而另一个案例将创建一个窗口的实例.

Click on the window controller and toggle between the two Presentation options. When you run it, you will find that one case will create multiple instances of the window, while the other will create a single instance of the window.

就像我说的那样,很明显,但是必须实际使用它来弄清楚.

Like I said, obvious, but had to actually use it to figure it out.

这篇关于"Multiple"和"Multiple"之间有什么区别?和“单"用于View Controller演示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆