Hey - does somebody know why i get a leak when i use this line of code ??? :
[self setModules:[[aDictionary objectForKey:KEY_MODULES] mutableCopy]];
Thanks in advance pk
Hey - does somebody know why i get a leak when i use this line of code ??? :
[self setModules:[[aDictionary objectForKey:KEY_MODULES] mutableCopy]];
Thanks in advance pk
As you create a copy of existing object via mutableCopy
then you're responsible to release it (assuming you also retain it in setModules method):
[self setModules:[[[aDictionary objectForKey:KEY_MODULES] mutableCopy] autorelease]];
Check also that you release modules
iVar in your class's dealloc method.
mutableCopy
creates a new copy with a retainCount of 1 and needs to be released.
[self setModules:[[[aDictionary objectForKey:KEY_MODULES] mutableCopy] autorelease]];