mpmediaplayercontroller

Quitting app causes error “Message from debugger: Terminated due to signal 9”

拟墨画扇 提交于 2019-11-27 14:36:24
I'm writing a basic music player app but having some problems when it comes to handling the app state transitions. I'm using Swift 3 and MPMusicPlayerController.systemMusicPlayer() The goal is this: 1) Keep music playing when user taps the Home button and app enters bg (works) 2) Stop the player ( myMP.stop() ) if the user the quits the app (works sometimes, throws error other times) I traced the flows using print statements based on possible actions and got this: Flow 2 is what I would expect, but Flow 1 throws an error when the app is closed - I would expect "will terminate" here. EDIT: The