Question

My application consists of a table view. When a cell is touched the navigation controller moves to a tab bar controller and the "root" view of the tab bar controller has a button that plays an mp3.

My question is this. When a user clicks the back button to go back to the table view and there is currently audio playing, how do I stop the audio playing?

First off I tried calling [audio stop] in the delloc and viewdidunload functions of the view where the audio object lives (the "root" of my tab bar controller). I put break points in these functions and they don't even get called.

Was it helpful?

Solution

Try one of these :) They are both part of the UIViewController class.

- (void)viewWillDisappear:(BOOL)animated

- (void)viewDidDisappear:(BOOL)animated
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top