-(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];
}
一切仍然有效,只是一個令人討厭的錯誤,可能會導致滯後。我得到錯誤,「從不兼容的類型」gameViewController「分配給'id avaudioplayerdelegate'」
你的問題是什麼? – Jason