开发者

(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'

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜