导航弧存储器未释放 [英] Navigation arc memory not released
问题描述
我有两个表控制器A和B. A有一个项目列表,当单击一个项目时,它会推送到B. 问题是当显示B时,该乐器指示实时内存增加,但是当我单击后退"按钮时却没有减少. B中的dealloc方法已执行,但内存似乎略有变化. 我检查了B是否在其他任何地方都没有保留,那么可能导致此问题的原因是什么?
I have two table table controllers A and B. A has a list of items and when an item is clicked, it pushes to B. The problem is that when B was shown, the instrutment indicated a live memory increase, but it did not decreased when I clicked on back button. The dealloc method in B was executed but the memory seemed changed slightly. I checked that B was not retained anywhere else so what may the reasons that can cause this problem?
在B中,有许多非原子性强的文本字段,标签.我用代码而不是xibs来绘制它们.如果我注释了用于初始化它们并将它们添加到表标题视图的代码,那么问题就消失了.
In B, there are many textfields, labels which are nonatomic and strong. I draw them in codes rather than using xibs. If I commented the codes for initializing them and adding them to the table header view, then the problem is gone.
我顺便使用了Arc和模拟器6.1.
I use Arc and simulator 6.1 by the way.
推荐答案
在我看来,B内的某些文本字段/标签可能对B本身有很强的引用,使得弧无法释放它们,因为B具有指向其中的和元素的强大指针,并且此元素具有指向B的强大指针.
It seems to me that some of the textfields/labels inside B might have some strong reference to B itself making it impossible for arc to release them cause B has a strong pointer to and element inside it and this element has a strong pointer to B.
据我所知,这不是文本字段/标签的默认行为,但也许您已经将它们子类化了...
As far as I know thats not the default behaviour of textfields/labels, but maybe you've subclassed them...
除了猜测您提供的少量信息外,很难尝试其他任何事情
Hard to try anything other than guessing with that little amount of information you gave
这篇关于导航弧存储器未释放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!