Question

In my Cocos2D app I have a pause view where I load a specific button based upon the playbackState of the applicationMusicPlayer. There is an issue though, the applicationMusicPlayer is always NULL. So I have an ivar for the musicPlayer and even the second time I launch the Pause View, it is still NULL.

Shouldn't it be at playbackState MPMusicPlaybackStateStopped even if I never played a song before in the app?

I NSLog it like this if this makes any difference:

NSLog(@"Playback State:%@", [MPMusicPlayerController applicationMusicPlayer].playbackState);

Any tips/suggestion or insight would be really helpful!

Thanks!

Was it helpful?

Solution

playbackState is not a nsobject, so should use %d.

NSLog(@"Playback State:%d", [MPMusicPlayerController applicationMusicPlayer].playbackState);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top