-(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];
}
everything still works, there’s just an annoying error that might be causing a lag.
Be sure
gameViewControllerconforms to theAVAudioPlayerDelegateprotocol:assuming that’s the name of your class.