I am trying to understand something that i thought i know.
if in class A i do :
-(NSMutableArray*)setArray:(NSMutableArray*) array1
{
//some calculations on array 1
return array1.
}
than in classB i :
ClassA *instanceA = [[ClassA alloc]init] ;
ClassC *instanceC = [[ClassC alloc]init] ;
[instanceC sendArray:[instanceA setArray:someArray] ]; //some array allocated in b
[instanceA release];
//in ClassC i have defined arrayC ,that gets array as a pointer from classB
Is array1 stay valid in ClassC after i released instanceA ?
Does every change made to the array in ClassB is also made to the arrayC ?
Is this the right way to work ? my goal is to control over the arrayC in ClassC so every change i do in ClassB will apply to the one in C also, AND to not lose this relation because of some autorelease.
Doing this with property will be better ? how ?
thanks.
sendArray:do? What isarrayC? How is it set?