2013-03-12 99 views
1

我正在关注此主题的前一个问题,试图让视频在我的应用程序中播放。我已将名为iobserve1.mov的视频复制到资源文件夹中,并在我的h文件中导入MediaPlayer/MediaPlayer.h。我收到以下错误:将影片添加到iPad应用程序

苹果Mach-O的连接错误 “_OBJC_CLASS _ $ _的MPMoviePlayerController”,从引用:

苹果Mach-O的连接错误 连接器的命令,退出代码1失败(使用-v来查看调用)

@interface ObViewControllerIObserveMovie() 
@property (weak, nonatomic) IBOutlet UIView *movieView; // this should point to a view where the movie will play 
@end 

@implementation ObViewControllerIObserveMovie 

- (void)viewDidLoad 
{ 
[super viewDidLoad]; 
NSString *moviePath = [[NSBundle mainBundle] pathForResource:@"iobserve1" ofType:@"mov"]; 
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:moviePath]]; 
player.view.frame = CGRectMake(184, 200, 400, 300); 
[self.view addSubview:player.view]; 
[player play]; 
} 

在这里的任何帮助将不胜感激。

+0

Mediaplayer框架丢失。 – Popeye 2013-03-12 17:22:05

回答

1

您是否已将MediaPlayer框架添加到您的项目中?它包含MPMediaPlayerController类

+0

搜索“在xcode中添加框架”在谷歌或http://stackoverflow.com/questions/3352664/how-to-add-existing-frameworks-in-xcode-4 – Popeye 2013-03-12 17:22:56

+0

得到你。伟大的东西感谢。虽然它现在似乎工作,并没有负载实际上播放。有任何想法吗? – RGriffiths 2013-03-12 17:26:32

+0

对不起,这是一个完全不同的问题,你将不得不问。 – Popeye 2013-03-12 17:47:15