Ios 为什么播放音乐时,锁屏和指挥中心上的控制按钮会禁用?
播放音乐时,为什么要禁用锁屏和命令中心上的控制按钮?我使用MPRemoteCommandCenter通过远程控制访问。非常感谢你的帮助 顺便说一句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
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:)];
}