gpt4 book ai didi

objective-c - 在没有释放的情况下从 View Controller 中删除 View 时内存会发生什么?

转载 作者:搜寻专家 更新时间:2023-10-30 20:22:34 24 4
gpt4 key购买 nike

如果我从 View Controller 中删除唯一的 View :[myViewController.view removeFromSuperview] 而没有 [myViewController release]。内存会被释放吗?

最佳答案

来自 Apple 的 UIView 文档 -removeFromSuperview:

If the receiver’s superview is not nil, the superview releases the receiver. If you plan to reuse a view, be sure to retain it before calling this method and release it again later as appropriate.

关于objective-c - 在没有释放的情况下从 View Controller 中删除 View 时内存会发生什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6554564/

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