Зарегистрироваться для MPMusicPlayerControllerPlaybackStateDidChangeNotification
уведомлений:
[notificationCenter addObserver:self selector:@selector(handlePlaybackStateChanged:) name:MPMusicPlayerControllerPlaybackStateDidChangeNotification object:self.musicPlayer];
и сообщите вашему musicPlayerController для генерации этих уведомлений:
[self.musicPlayerController beginGeneratingPlaybackNotifications];
В handlePlaybackStateChanged:
вы можете проверить свойство playbackState
musicPlayerController:
- (void)handlePlaybackStateChanged:(NSNotitication*)notification
{
if (self.musicPlayerController.playbackState == MPMusicPlaybackStateStopped ||
self.musicPlayerController.playbackState == MPMusicPlaybackStateInterrupted ||
self.musicPlayerController.playbackState == MPMusicPlaybackStatePaused) {
// do your stuff
}
}