I've created several apps using buttons, so I know this should be working. The deal is I'm trying to make a mute button to stop sound from playing. I don't get any errors when I compile, but when I load the app in the stimulator or on the phone, it doesn't do anything when I press the mute button. Here is how I implemented it:
I know it's not a problem of connecting the button to the action in IB because I made SURE (100%) that I connected it correctly. Did I stop the music incorrectly? Is [backgroundMusic stop]; not what I should be using to stop the sound in this situation? Any replies would be appreciated. Thanks!
I think you should keep the reference of the backgroundMusic AVAudioPlayer you initaited in viewDidLoad, and stop the playing of this particular player in the IBAction function
__________________
My app: LyricBox(iPad ready for upload) more coming...
I think you should keep the reference of the backgroundMusic AVAudioPlayer you initaited in viewDidLoad, and stop the playing of this particular player in the IBAction function
If I do this, it will then give me an error saying backgroundMusic undeclared. I am at a complete loss here.
I know it's not a problem of connecting the button to the action in IB because I made SURE (100%) that I connected it correctly. Did I stop the music incorrectly? Is [backgroundMusic stop]; not what I should be using to stop the sound in this situation? Any replies would be appreciated. Thanks!
Don't use IB. Wire up the events manually, then come back and report your findings.