问题
I created instance AVAudioPlayer but the instance is working only once like if I give
if(a.playing)
{
i=1
}
else
{
i=2
}
for 1st time its giving i=1 while playing and other times its giving i=2 while playing.
回答1:
AVAudioPlayer reference Reference clearly mentions this about the playing property
Important: Do not poll this property (that is, do not use it inside of a loop) in an attempt to discover when playback has stopped.
Perhaps u can try [audioPlayer isPlaying];
来源:https://stackoverflow.com/questions/5271332/avaudioplayer-playingsong