开发者

Using SystemSoundID throughout my app?

开发者 https://www.devze.com 2023-01-07 07:47 出处:网络
Can someone please point me in the right direction... I need to use the same sound (a button press) throughout all view controllers in my app. What is the best way to do this. I have managed to load a

Can someone please point me in the right direction... I need to use the same sound (a button press) throughout all view controllers in my app. What is the best way to do this. I have managed to load and play a sound in a single view controller but cannot manage to pass a sound to different viewcontrollers because SystemSoundID is not an object and so I cannot use it as a property?? Can someone please help as this is driving me crazy and Im sure its 开发者_StackOverflow中文版something simple that Im missing!!


You can define the property like this:

@property (assign) SystemSoundID clickSound;

Then when you create your view controller, you can set it thusly:

viewController.clickSound = aSoundID;

0

精彩评论

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