MPMusicPlayerControllerPlaybackStateDidChangeNotificationは、プレイヤーオブジェクトが実際に状態を更新する前に表示されることがあります。しかし、あなたは通知のuserInfo辞書から新しい状態を取得することができます(これは、おそらくそこにあります)。コードで
:
- (void)playbackStateDidChange:(NSNotification *)notification {
static NSString * const stateKey = @"MPMusicPlayerControllerPlaybackStateKey";
NSNumber *number = [[notification userInfo] objectForKey:stateKey];
MPMusicPlaybackState state = [number integerValue];
// state is the new state
MPMusicPlayerController *player = [notification object];
// state may not be equal to player.playbackState
}