Best practice with memory use
I have the question for the forum
I have the array and I use it for the operation
I want set the result of this array at another array
NSArray *array1 = [[NSArray alloc]init];
NSArray *array2 = [[NSArray alloc]init];
array2 = array1
With pointers by doing this assignment check the memory area in array1
that of array2
on some examples see this type of assignment
array2 = [array1 retain];
and subsequently
[array1 release];
the release in this case decreases the retainCount and brings it back to the previous value. but also allows you to remove the object array1 and this point to the memory cell??
Thanks
|