IBOutlet应该是弱变量还是强变量?

编程入门 行业动态 更新时间:2024-10-22 11:27:27
本文介绍了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应该是弱变量还是强变量?

本文发布于:2023-11-15 21:24:38,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1598079.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:变量   应该是   IBOutlet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!