问题
I'm using MPMusicPlayerController
, specifically with setNowPlayingItem
protocol and it's for cydia
. But I have some issues and theos' warning when i make. It seems that some of the protocols and methods are not working and I receive some warning like this:
Tweak.xm:177: warning: ‘MPMusicPlayerController’ may not respond to ‘-skipToPreviousItem’
Tweak.xm:188: warning: ‘MPMusicPlayerController’ may not respond to ‘-pause’
Tweak.xm:193: warning: ‘MPMusicPlayerController’ may not respond to ‘-play’
Tweak.xm:201: warning: ‘MPMusicPlayerController’ may not respond to ‘-skipToNextItem’
Tweak.xm:317: warning: ‘MPMusicPlayerController’ may not respond to ‘-setNowPlayingItem:’
Have anyone some ideas? I enter the protocol already in prototype
回答1:
I don't think it's because of cydia - it sounds like a compilation issue.
Have you definitely got
#import <MediaPlayer/MediaPlayer.h>
in your file?
回答2:
have you added the MediaPlayer.framework
to your project?
- select your project in the project navigator
- select your target on the right side
- select the "Build Phases" tab
- open "Link Binary With Libraries"
- add your framework
来源:https://stackoverflow.com/questions/7572960/mpmusicplayercontroller-and-setnowplayingitem