Should I release NSBundle in the below code or not? NSURL should also be release or not?
I am confused.
NSBundle *mainBundle = [NSBundle mainBundle];
NSError *error;
NSURL *audioURL = [NSURL fileURLWithPath:[mainBundle pathForResource:@"count_in" ofType: @"mp3"]];
AVAudioPlayer *player1 = [(AVAudioPlayer*) [AVAudioPlayer alloc] initWithContentsOfURL:audioURL error:&error];
self.player = player1;
[self.player play];
[player1 release];
You should not release
NSBundleandNSURLinstances because you haven’t alloced these.From the apple Documentation.
I would highly recommend you to clear your memory management concept.
Read the apple article on
Memory Management Rules