MPMusicPlayerController是否改变了iOS 5?

我有一个应用程序,在iOS 4.3中正常工作,升级到iOS 5后,它的行为以另一种方式。
在iOS 4.3上执行这些行后,mp.playbackState被设置为MPMusicPlaybackStatePaused,但是在iOS 5中,它仍然被设置为MPMusicPlaybackStatePlaying。

MPMusicPlayerController *mp = [MPMusicPlayerController applicationMusicPlayer]; if(mp.playbackState == MPMusicPlaybackStatePlaying) [mp pause]; 

我假设playbackState没有在同一个事件循环内更新,可以吗?

我认为这个问题是:

 MPMusicPlaybackState playbackState = [musicPlayer playbackState]; 

在iOS5中并不总是正确的。

这为我工作:

 if (!isPlay) { isPlay = TRUE; [appPlayer play]; } else { isPlay = FALSE; [appPlayer pause]; }