MPMusicPlayerController *ipodMusicPlayer = [MPMusicPlayerController iPodMusicPlayer];
[ipodMusicPlayer beginGeneratingPlaybackNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(trackTheDeviceVolume:)
name:MPMusicPlayerControllerVolumeDidChangeNotification
object:nil];
[ipodMusicPlayer beginGeneratingPlaybackNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(trackTheDeviceVolume:)
name:MPMusicPlayerControllerVolumeDidChangeNotification
object:nil];
本文介绍如何使用Objective-C监听iOS设备上MPMusicPlayerController的音量变化,并注册通知来跟踪这些变化。
2万+

被折叠的 条评论
为什么被折叠?



