Jules
Jules

Reputation: 660

Using SystemSoundID throughout my app?

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 something simple that Im missing!!

Upvotes: 0

Views: 1207

Answers (1)

lucius
lucius

Reputation: 8685

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;

Upvotes: 1

Related Questions