MPMusicPlayerController and setNowPlayingItem

痴心易碎 提交于 2019-12-10 15:13:52

问题


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?

  1. select your project in the project navigator
  2. select your target on the right side
  3. select the "Build Phases" tab
  4. open "Link Binary With Libraries"
  5. add your framework


来源:https://stackoverflow.com/questions/7572960/mpmusicplayercontroller-and-setnowplayingitem

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!