When a different sound is selected in a TableView, the name of the sound is added to a variable. In a different view controller, it is supposed to access the variable and play the sound when a button is pressed, though it instead just plays the same sound. Here is the code:FirstSoundController (Plays Sound):class FirstViewController: UIViewController { var someVariable = SecondViewController() @IBAction func activation(sender: UIButton) { if sender.titleLabel!.text == ACTIVATE { sender.setTitle(DEACTIVATE, forState: UIControlState.Normal) var someSound = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource(someVariable.soundSelected, ofType: mp3)!) audioPlayer = AVAudioPlayer(contentsOfURL: someSound, error: nil) audioPlayer.prepareToPlay() audioPlayer.play() } else { sender.setTitle(ACTIVATE, forState: UIControlState.Normal) audioPlayer.stop() }}SecondViewController (Shows table of Sounds):class SecondViewController: UIViewController, UITableViewD