i'm using notifications from the NSNotificationCenter to pick up MPMusicPlayerController notifications.
I use these notifications to change the state of a button in my view from "play" to "pause" states.
It "works" however sometimes the MPMusicPlayerController (iPodMusicPlayer to be exact) does not report the correct state and thus my buttons get all messed up, and don't operate correctly.
Having done some investigating, I found that notifications are triggered a lot when changing the current playing song.
For example: When I choose a song, I call: - stop - setQueueWIthItemCOllection - nowPlayingItem - play
These calls, launch so many notifications. After the stop, I get notified 2 times for nowPlayingItem for example after the nowPlayingItem call... ???
Also, after even forcing my buttons to behave relative to their "picture" state rather than the MPMusicPlayerController playbackstate, the controller still does not reflect the correct state. For example, a song will be playing in the background (I can hear it, the "play" icon is on in the far top right of the ipad next to the battery icon), but the MPMusicPlayerController iPodMusicPlayer reports state "Pause" ...
Does anyone have any info or help on this ?
Cheers