AVAudioPlayer를 사용하고 있습니다. 다시 소리를 내고 agian을 호출하고이 응용 프로그램을이 응용 프로그램에서 100 번 호출합니다. 문제는 내가 항상 알록하지만 시간이 갈 때입니다. 놓으면 소리가 나지 않습니다. 나는 무엇을 할 것이다.AVAudioPlayer 누수와 경고 그리고 결국 응용 프로그램이 깨졌습니다.
-(void) ButtonSound
{
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"Button1"
ofType:@"mp3"];
NSURL *fileURL = [[NSURL alloc] initFileURLWithPath:filePath];
player = [[AVAudioPlayer alloc] initWithContentsOfURL:fileURL error:nil];
[player play];
[fileURL release];
}
메모리가 누수되어 응용 프로그램이 손상된 경우 플레이어를 한 번에 할당하고 계속해서 사용하고 싶습니다.