iPhone在读取字符串值时泄漏

时间:2011-09-19 14:09:02

标签: iphone ios

仪器工具说这是泄漏,有什么想法吗?

我在for循环结束时释放变量对象

enter image description here

enter image description here

并且通过上面方法的开头,这就是我如何设置变量obkect,那就是自动释放;

NSMutableArray *variables = nil; 
if (self.responseXMLData) {
    variables = [NSMutableArray arrayWithCapacity:10];
            //here is the all the code in the if statement which posted the screen shots

2 个答案:

答案 0 :(得分:2)

对所有新读者,在编辑问题之后;这不是答案!


您不会在任何地方发布variables

您致电alloc] init],因此您有责任release:)

答案 1 :(得分:1)

确保在dealloc(或某处)释放self.variables属性。另外,请确保您的Variable类正在variableValues类的dealloc中发布Variable属性。

相关问题的答案相同:iPhone Leak on UITextfield text