Leak from NSURL and AVAudioPlayer using ARC
问题 I am runung Instruments on an iPhone 4S. I am using AVAudioPlayer inside this method: -(void)playSound{ NSURL *url = [self.word soundURL]; NSError *error; audioPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL:url error:&error]; if (!error) { [audioPlayer prepareToPlay]; [audioPlayer play]; }else{ NSLog(@"Problem With audioPlayer on general card. error : %@ | url %@",[error description],[url absoluteString]); } I am getting leaks when playing the sound files: Leaked objects: 1. Object :