Error in xcode when i try to compile using a MPVolumeView
-
22-02-2021 - |
Domanda
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?
Soluzione
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
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow