App crashes when playing audio on iOS13.1

前端 未结 3 420
无人及你
无人及你 2020-12-29 06:41

I am building an app that runs sound files from within the main bundle with a url. When I tested this on iOS 13, everything is fine. But with the new update of 13.1 I am get

3条回答
  •  一向
    一向 (楼主)
    2020-12-29 07:06

    Change this:

    var backgroundMusicPlayer = AVAudioPlayer()
    

    To this:

    var backgroundMusicPlayer : AVAudioPlayer!
    

提交回复
热议问题