IBOutlet应该是弱变量还是强变量? [英] Should IBOutlet be weak or strong var?

查看:114
本文介绍了IBOutlet应该是弱变量还是强变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将Xcode 6.2用于iOS项目.在较早版本的Xcode中,为IBOutlet创建连接时,它始终是弱存储.现在,当我创建连接时,它们默认为强连接.我就这样走了,没有发现任何区别.

I'm using Xcode 6.2 for iOS projects. In older versions of Xcode, when a connection was create for an IBOutlet, it was always weak storage. Now when I create connections, they are defaulted to strong. I leave it that way and don't notice any difference.

哪个版本的Xcode的默认设置更改为强"?为什么?

Which version of Xcode did the default change to strong and why?

推荐答案

是的,以前的销售渠道通常应该薄弱,但苹果公司已经改变了这一点.现在他们建议在WWDC 2015会话中使用 strong 网点在Interface Builder中实现UI设计. 原因可能很弱的唯一原因是保留周期.

Yes, previously outlets should generally be weak but Apple has changed that. Now they recommend to use strong outlets in the WWDC 2015 session Implementing UI Designs in Interface Builder. The only reason why it might be weak is retain cycle.

这篇关于IBOutlet应该是弱变量还是强变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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