In Following code
NSURL *file = [[NSURL alloc] initFileURLWithPath: [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:soundName]];
// NSData *data = [NSData dataWithContentsOfURL:file];
myExampleSound1 =[[AVAudioPlayer alloc] initWithContentsOfURL:file error:nil];
myExampleSound1.volume=0.9;
[myExampleSound1 prepareToPlay];
myExampleSound1.delegate = self;
[myExampleSound1 play];
[soundsArray addObject:myExampleSound1];
NSLog(@"RETAIN COUNT BEFORE RELEASE file = %d, myExampleSound1=%d, soundsArray=%d", [file retainCount],[myExampleSound1 retainCount], [soundsArray retainCount]);
[file release];
NSLog(@"RETAIN COUNT AFTER RELEASE file = %d, myExampleSound1=%d, soundsArray=%d", [file retainCount],[myExampleSound1 retainCount], [soundsArray retainCount]);
I am printin the retain count of file is 4 before release and 3 after release. Thanks in advance