Instruments tools says this is a leak, any ideas?
I release the variable object by end of the for loop
and by the begininng of the method above this is how I set the variables obkect, thats autorelease;
NSMutableArray *variables = nil;
if (self.responseXMLData) {
variables = [NSMutableArray arrayWithCapacity:10];
//here is the al开发者_如何学运维l the code in the if statement which posted the screen shots
To all the new readers, after the edit to the question; this isn't the answer !
Yes.
You don't release variables
anywhere.
You call alloc] init]
so it's your responsibility to release
it :)
Make sure you are releasing self.variables
property in your dealloc (or somewhere). Also, ensure that your Variable
class is releasing variableValues
property in the Variable
class's dealloc.
Same answer from related question: iPhone Leak on UITextfield text
精彩评论