I have used [anArray retainCount]
to get the retain count of array..(i know this should not be used but i am using just for learning retain concept)
Following is my code.
NSString *str = [[NSString alloc] initWithFormat:@"a,b,c,d"];
NSArray *anArray =[[NSArray alloc]init];
NSLog(@"Retain count: %i", [anArray retainCount]);
anArray=[str componentsSeparatedByString:@","];
NSLog(@"Retain count: %i", [anArray retainCount]);
output
Retain count: 2
Retain count: 1
i think it should be opposite but....