I have this classA that has a method in it, that is being called from another classB to get the coordinates of a sprite.
when i call that method in the classA, it returns NSMutablearray, but then i want to release that array.
so if i release classA, is that ok? all the allocated array in it are being releaseD ? NO..
or should i release the array in the dealloc of the called classA ?
gameHandler.m
-(NSMutableArray*)stand2_Co
{
...
return myArray
}
and then call it from another class :
theLevel=[[gameHandler alloc] init];
..
..
int theNumber = [ [ [theLevel stand2_Co] objectAtIndex:0] integerValue];
[theLevel release];
if i release the gameHandler , i need to also release that array ?
if so, when should i do that ?
thanks a lot .
object you own
Memory Management Programming Guide