MPMusicPlayerController deprecated with iOS 6
ios, ios6, mpmediaplayercontroller
Solution
The `MPMusicPlayerController` class conforms to the `MPMediaPlayback` protocol, and calling `[MPMusicPlayerController iPodMusicPlayer]` returns an instance of `MPMusicPlayerController`. Moreover, all the deprecated methods that were removed from the `MPMusicPlayerController` class are present in the `MPMediaPlayback` protocol. What this means is that:
No changes should be required for your code to work under iOS 6. The `play` method still exists for every `MPMusicPlayerController` instance, and calling it should do the same thing that it always has.
No methods have actually been "removed". They were moved into a protocol, presumably because having an abstraction of a media player API allows for very cool things to be done by providing custom object implementations that conform to the `MPMediaPlayback` protocol.
Problem
I've just seen iOS 5.1 to iOS 6.0 API Differences released by Apple. They say that some important methods of `MPMusicPlayerController.h` are removed to `MPMediaPlayback` protocol (play, pause, stop...). Does somebody know how to update my application who use the code below to work with the iOS 6? ``` MPMusicPlayerController *musicPlayer = [MPMusicPlayerController iPodMusicPlayer]; musicPlayer play; ```