开发者

MPMoviePlayerController undeclared (first use in the function) message

I dont know why I am getting this message when I click have this code

MPMoviePlayerController *mp 开发者_高级运维= [[MPMoviePlayerController alloc] iniWithContentURL: url];

Is there something, I am missing here?

Thanks


You need to import/include the movie player:

#import <MediaPlayer/MediaPlayer.h>

Furthermore, the MediaPlayer.framework must be added to your "Frameworks" folder in the XCode project. To add the framework, right-click on "Frameworks", then select the path on your system where this framework resides. On my system it is under the following path:

/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk/System/Library/MediaPlayer.framework


Make sure you are linking to MediaPlayer.framework in your Xcode project. That's where MPMoviePlayerController comes from and if you don't link to it, the linker won't know what it is.


MediaPlayer.framework must be added to your "Frameworks" and #import <MediaPlayer/MediaPlayer.h> in your .h file

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜