当我尝试使用 MPVolumeView 进行编译时,xcode 中出现错误
xcode 给了我这个错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MPVolumeView", referenced from:
objc-class-ref in VolumeViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
这是 viewcontroller 的 viewDidload 。
- (void)viewDidload{
[super viewDidUnload];
MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame:CGRectMake(0, 0, 200, 20)] autorelease];
volumeView.center = CGPointMake(160,134);
[volumeView sizeToFit];
volumeView.showsVolumeSlider=YES;
[self.view addSubview:volumeView];
}
我导入:
#import <MediaPlayer/MPVolumeView.h>
可能是什么错误?
xcode gives me that error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_MPVolumeView", referenced from:
objc-class-ref in VolumeViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
this is viewDidload of viewcontroller.
- (void)viewDidload{
[super viewDidUnload];
MPVolumeView *volumeView = [[[MPVolumeView alloc] initWithFrame:CGRectMake(0, 0, 200, 20)] autorelease];
volumeView.center = CGPointMake(160,134);
[volumeView sizeToFit];
volumeView.showsVolumeSlider=YES;
[self.view addSubview:volumeView];
}
I import:
#import <MediaPlayer/MPVolumeView.h>
What could be the error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在您的项目中添加 MediaPlayer 框架:
项目 -> 构建阶段 -> 将二进制文件与库链接:
Add MediaPlayer framework in your project:
Project -> Build phases -> Link binary with libraries:
错误表明链接器找不到类 MPVolumeView
您需要将包含此类的库或框架添加到 XCode
The error says that the linker cannot find the class MPVolumeView
You need to add the library or framework that includes this class to XCode