avaudioplayer-two background music problem
I have two .xibs in my app. The first .xib contains a round rectangle button that opens second .xib. ViewDidLoad 开发者_如何学编程method of second .xib starts a background music(mp3 file) using AVAudioPlayer and then shows an animation by running a sequence of images. Now second .xib button has a "back button".
If I click on the back button before animation and audio stops, reach on first xib and click on round rectangle button again then it starts two background music files.
How do I fix it?
Also, how do you stop music if a song is already playing on ipod when app's background music starts?
精彩评论