开发者

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜