[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_observerApplicationVolumeAction:) name:KNotificationApplicationSystemVolumeDidChange object:nil];
[[UIApplication sharedApplication] beginReceivingRemoteControlEvents];
- (void)_observerApplicationVolumeAction:(NSNotification *)sender {
if ([sender.name isEqualToString:KNotificationApplicationSystemVolumeDidChange]) {
NSLog(@"_observerApplicationVolumeAction");
}
}
#pragma mark App音量调节
#define KNotificationApplicationSystemVolumeDidChange @"AVSystemController_SystemVolumeDidChangeNotification"
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
NSLog(@"dealloc:%@",self);
}
网友评论