Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
unsafe_unretained IBOutlet 对象是在视图消失时释放(viewWillDisappear或viewDidDisappear)还是在视图卸载时释放(viewDidUnload)?
viewWillDisappear
viewDidDisappear
viewDidUnload
IBOutlets 永远不应该与他们的 View Controller 形成强烈的保留关系,因为它们不属于它。所以实际上,它们只是在视图控制器脱离上下文时被释放。由于它们的引用极弱,它们在视图控制器被释放时被释放,这种情况随时都可能发生。没有具体的功能。