问题描述
我正在做的是在后台创建许多UIView,并将它们保存在NSMutableArray中以备后用.但是,当我关闭视图控制器时,我检查了Xcode中的内存,似乎有些内存没有释放.我检查了;视图控制器被释放.
What am I doing is I am creating lots of UIView in the background and keep them in a NSMutableArray to use later. But when I dismiss the view controller I check the memory in Xcode and it seems some of memory not being released. I checked; view controller is being deallocated.
请检查:
这是在多次显示并关闭视图控制器之后发生的.其中一些已被释放,但不是全部.谢谢.
This happend after several showing and dismissing the view controller. Some of them is being released but not all.Thanks.
推荐答案
取消选中编辑方案"下的Enable Zombie Objects
选项.然后再试一次.
Uncheck Enable Zombie Objects
option under Edit Scheme. And try again.
僵尸是已经被释放的对象,但是对它的引用仍然存在,并且消息仍在发送给它
A zombie is an object that has been deallocated, but references to it still exist and messages are still being sent to it
我认为此链接为您提供了更多信息什么是NSZombie?
I think this link has more info for youWhat is NSZombie?
这篇关于关闭视图控制器后,即使调用dealloc方法也无法释放内存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!