Audio file not working on device but it is working on simulator

后端 未结 2 580
盖世英雄少女心
盖世英雄少女心 2021-01-24 07:39

I am playing audio in iphone app but problem is that it works fine on simulator but it is not working on device here is my code it just closes the app when this code runs.

2条回答
  •  渐次进展
    2021-01-24 08:22

    First add AVFoundation.framework and add below code.

    in .h file

    #import 
    

    and .m file

     [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:nil];
    

提交回复
热议问题