Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 为什么播放音乐时,锁屏和指挥中心上的控制按钮会禁用?_Ios_Objective C_Audio_Remote Control_Remotecommand - Fatal编程技术网

Ios 为什么播放音乐时,锁屏和指挥中心上的控制按钮会禁用?

Ios 为什么播放音乐时,锁屏和指挥中心上的控制按钮会禁用?,ios,objective-c,audio,remote-control,remotecommand,Ios,Objective C,Audio,Remote Control,Remotecommand,播放音乐时,为什么要禁用锁屏和命令中心上的控制按钮?我使用MPRemoteCommandCenter通过远程控制访问。非常感谢你的帮助 顺便说一句 应用程序没有被杀死 我添加admob SDK作为我的应用程序插入广告 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.1) { MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCente

播放音乐时,为什么要禁用锁屏和命令中心上的控制按钮?我使用MPRemoteCommandCenter通过远程控制访问。非常感谢你的帮助

顺便说一句

  • 应用程序没有被杀死
  • 我添加admob SDK作为我的应用程序插入广告
  •     if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.1) {
        MPRemoteCommandCenter *commandCenter = [MPRemoteCommandCenter sharedCommandCenter];
        commandCenter.playCommand.enabled = YES;
        [commandCenter.playCommand addTarget:self action:@selector(playAction:)];
    
        [commandCenter.pauseCommand addTarget:self action:@selector(pauseAction:)];
    
        commandCenter.previousTrackCommand.enabled = YES;
        [commandCenter.previousTrackCommand addTarget:self action:@selector(previousTrackAction:)];
    
        commandCenter.nextTrackCommand.enabled = YES;
        [commandCenter.nextTrackCommand addTarget:self action:@selector(nextTrackAction:)];
    
        commandCenter.togglePlayPauseCommand.enabled = YES;
        [commandCenter.togglePlayPauseCommand addTarget:self action:@selector(playOrPauseAction:)];
    }