Reputation: 13061
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?
Upvotes: 1
Views: 1878
Reputation: 2641
Add MediaPlayer framework in your project:
Project -> Build phases -> Link binary with libraries:
Upvotes: 4
Reputation: 32720
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
Upvotes: 2