Where should I kill my AVFoundation AudioPlayer
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 开发者_StackOverflowdelloc 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.
Try one of these :) They are both part of the UIViewController class.
- (void)viewWillDisappear:(BOOL)animated
- (void)viewDidDisappear:(BOOL)animated
精彩评论