简体   繁体   中英

Navigation from AppDelegate to a view controller don't disable the audio playing of previous view controller

i am a newbie in iOS programming. I am having a problem with navigation controller. My rootViewController is 'WelcomeViewController'. I navigate to 'AbcViewController' from the root view & when the 'AbcViewController' is loaded it plays an audio file. But when i receive an special message into my 'AppDelegate' class, i am pushing into XyzViewController from the AppDelegate class. But the problem is the audio playing of AbcViewController continues playing though the current view is showing the XyzViewController. But the player shouldn't play while the visible controller is XyzViewController. I think there is a problem with my navigation. How can i solve this problem?

As already stated by Robert, you need to stop audio in AbcViewController viewWillDisapper:

Hope that help.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM