- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[[NSNotificationCenter defaultCenter]
addObserver:self
selector:@selector(volumeChanged:)
name:@"AVSystemController_SystemVolumeDidChangeNotification"
object:nil];
}
- (void)volumeChanged:(NSNotification *)notification
{
float volume =
[[[notification userInfo]
objectForKey:@"AVSystemController_AudioVolumeNotificationParameter"]
floatValue];
// Do stuff with volume
}
는 당신은 AudioSessionSetActive
와 오디오 세션을 시작하고 처음 애플이 제공하는 샘플 코드 (나는 'aurioTouch'를 사용)를 보시기 바랍니다 않았다. 어쩌면 무슨 일이 일어 났는지 알아내는 데 도움이 될 수 있습니다.
고마워요 :) – hgpl