gpt4 book ai didi

ios - 弱引用 IBOutlet -- @property (assign)?

转载 作者:行者123 更新时间:2023-11-28 23:17:48 24 4
gpt4 key购买 nike

通过将 @property 定义为 assign 来弱引用 IBOutlet 以防止保留循环是否是一种有效的方法?例如,我可能想告诉 View 什么对象是它的 Controller ;虽然有使用 nextResponder 的解决方法,但简单地向 View 添加导出并将 Controller 分配给 View 要容易得多。

最佳答案

当然可以。您引用的案例很好地说明了您何时应该这样做。

关于ios - 弱引用 IBOutlet -- @property (assign)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5196984/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com