-(void)playSound: (NSString*)sound
{
NSString *path = [[NSBundle mainBundle] pathForResource:sound ofType:@"mp3"];
AVAudioPlayer* theAudio = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:path] error:NULL];
theAudio.delegate = self;
[theAudio play];
[AVAudioPlayer release];
}
一切仍然有效,只是一个恼人的错误可能会导致延迟。