(iphone) How to play the same sound from multiple views using AudioServicesPlaySystemSound?
I'd like to play button tap sound from various UIButton instances.
I'm planning to create a singleton to hold "System开发者_开发百科SoundID" of sound files that will be shared across many buttons.
Will this work? (SystemSoundID won't change during app's lifetime?)
Is there a other recommended way of doing this?Thank you
I would suggest you to sub-class UIButton
and override its any of the touch event (as you want) and play sound.... by this way you don't have to worry about playing sound each time, which will be the case even you put the code in 'appdelegate'
精彩评论