简体   繁体   English

IBOutlet发布

[英]IBOutlet release

当视图消失( viewWillDisappearviewDidDisappear )时是否释放unsafe_unretained IBOutlet对象,还是在视图卸载时释放它们( viewDidUnload )?

IBOutlets should never form a strong retain-relationship to their View Controller because they are not owned by it. IBOutlets永远不应与其View Controller形成强大的保留关系,因为它们并非由它拥有。 So in effect, they are just released when the view controller passes out of context. 实际上,它们只是在视图控制器超出上下文时才会释放。 Because of their extremely weak references, they are deallocated when the view controlle is deallocated, which can occur at any time. 由于它们的引用非常弱,因此在取消分配视图控件时会释放它们,这可以随时发生。 There is no specific function. 没有具体的功能。

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

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