سؤال

Using AVAudioPlayer we can play more than 1 song in a loop using this method:

- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag

to play the next song. But is it possible to identify the AVAudioPlayer instance since at a single time there are many AVAudioPlayer playing separate playlist in a app.

هل كانت مفيدة؟

المحلول

The player (first argument) from

- (void)audioPlayerDidFinishPlaying:(AVAudioPlayer *)player successfully:(BOOL)flag  

is the AVAudioPlayer, that you are looking for.

So you can check it:

if ([player isEqual:self.audioPlayer1])
{
    //Do something
} 
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top