简体   繁体   English

iOS 6中的强弱IBOutlet

[英]strong weak IBOutlet in iOS 6

The general recommendation was to use weak IBOutlet for the subviews. 总体建议是对子视图使用弱IBOutlet。 But now in iOS 6, views are no longer purged with memory warning, so is there any real practical difference between declaring an outlet as weak vs strong? 但是现在在iOS 6中,视图不再带有内存警告,因此将出口声明为弱与强之间有什么实际的实际区别? I mean practical and not theoretical. 我的意思是实践而不是理论。

Apparently from a practical point of view, the only advantage of declaring your IBOutlets as weak comes when you somehow want to unload your view manually in your application. 显然,从实际的角度来看,将IBOutlets声明为弱的唯一优点是,当您以某种方式想要在应用程序中手动卸载视图时。

I will mark this as "accepted" until someone provides a better answer. 在有人提供更好的答案之前,我将其标记为“已接受”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM