Can't beginReceivingRemoteControlEvents in iOS

前端 未结 4 1579
孤城傲影
孤城傲影 2021-02-14 17:04

In my app i want let user to control audio playback in background. I set backGround modes in .plist, and in plays in bg just like i wanted.But i can\'t get any response from tou

4条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-14 17:55

    You have

    respondsToSelector:@selector(beginReceivingRemoteControlEvents)]){
    

    but in the method signature you have

    - (void)remoteControlReceivedWithEvent:(UIEvent *)event
    

    The place where you are registering the signature is wrong. Just replace it by

    respondsToSelector:@selector(beginReceivingRemoteControlEvents:)]){
    

    You are missing the : which is making the app send the even to a non existing method I am assuming. I am surprised that your app is not crashing.

提交回复
热议问题