0
我有一個簡單的問題:我找到了一種方法來停止播放文件時播放第二個文件,以便它們不重疊。現在我的問題是,如何將這個方法應用於例如7個文件而不會使語句太長?防止多個聲音文件重疊如播放
- (IBAction)playSound1 {
if (self.sound2Player.playing)
[self.sound2Player stop];
[self.sound1Player play];
}
- (IBAction)playSound2 {
if (self.sound1Player.playing)
[self.sound1Player stop];
[self.sound2Player play];
}
謝謝,我會盡快把它弄出來! –