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)
[anArray retainCount]
Follow
This line... anArray=[str componentsSeparatedByString:@","];
You squished the original assignment of 'anArray' (thus creating a leak). In real life, you'd want to [anArray release] first. That's why the retain count went back to 1.