Vor iOS 5 wurde das AVFoundationFramework verwendet, aber es funktioniert nicht mit iOS 5 Storyboard-Anwendungen. Es treten Verknüpfungsfehler auf, auch wenn ich das Framework hinzufüge. Bitte hilf mir.
Die untenstehende Methode gibt mir die obersten 3 oder 4 Fehler.
- (id) init
{
self = [super init];
if (self != nil) {
void (^deviceConnectedBlock)(NSNotification *) = ^(NSNotification *notification) {
AVCaptureDevice *device = [notification object];
BOOL sessionHasDeviceWithMatchingMediaType = NO;
NSString *deviceMediaType = nil;
if ([device hasMediaType:AVMediaTypeAudio])
deviceMediaType = AVMediaTypeAudio;
else if ([device hasMediaType:AVMediaTypeVideo])
deviceMediaType = AVMediaTypeVideo;
if (deviceMediaType != nil) {
for (AVCaptureDeviceInput *input in [session inputs])
{
if ([[input device] hasMediaType:deviceMediaType]) {
sessionHasDeviceWithMatchingMediaType = YES;
break;
}
}
if (!sessionHasDeviceWithMatchingMediaType) {
NSError *error;
AVCaptureDeviceInput *input = [AVCaptureDeviceInput deviceInputWithDevice:device error:&error];
if ([session canAddInput:input])
[session addInput:input];
}
}
if ([delegate respondsToSelector:@selector(captureManagerDeviceConfigurationChanged:)]) {
[delegate captureManagerDeviceConfigurationChanged:self];
}
};
void (^deviceDisconnectedBlock)(NSNotification *) = ^(NSNotification *notification) {
if ([delegate respondsToSelector:@selector(captureManagerDeviceConfigurationChanged:)]) {
[delegate captureManagerDeviceConfigurationChanged:self];
}
};
NSNotificationCenter *notificationCenter = [NSNotificationCenter defaultCenter];
[self setDeviceConnectedObserver:[notificationCenter addObserverForName:AVCaptureDeviceWasConnectedNotification object:nil queue:nil usingBlock:deviceConnectedBlock]];
[self setDeviceDisconnectedObserver:[notificationCenter addObserverForName:AVCaptureDeviceWasDisconnectedNotification object:nil queue:nil usingBlock:deviceDisconnectedBlock]];
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[notificationCenter addObserver:self selector:@selector(deviceOrientationDidChange) name:UIDeviceOrientationDidChangeNotification object:nil];
orientation = AVCaptureVideoOrientationPortrait;
}
return self;
}
Undefinierte Symbole für Architektur i386:
"_OBJC_CLASS_$_AVCaptureDeviceInput", referenziert von:
objc-class-ref in AVCamCaptureManager.o
"_OBJC_CLASS_$_AVCaptureStillImageOutput", referenziert von:
objc-class-ref in AVCamCaptureManager.o
"_OBJC_CLASS_$_AVCaptureSession", referenziert von:
objc-class-ref in AVCamCaptureManager.o
"_OBJC_CLASS_$_AVCaptureDevice", referenziert von:
objc-class-ref in AVCamCaptureManager.o
"_AVCaptureDeviceWasConnectedNotification", referenziert von:
-[AVCamCaptureManager init] in AVCamCaptureManager.o
"_AVCaptureDeviceWasDisconnectedNotification", referenziert von:
-[AVCamCaptureManager init] in AVCamCaptureManager.o
"_AVMediaTypeAudio", referenziert von:
___27-[AVCamCaptureManager init]_block_invoke_0 in AVCamCaptureManager.o
-[AVCamCaptureManager micCount] in AVCamCaptureManager.o
-[AVCamCaptureManager(InternalUtilityMethods) audioDevice] in AVCamCaptureManager.o
"_AVMediaTypeVideo", referenziert von:
___27-[AVCamCaptureManager init]_block_invoke_0 in AVCamCaptureManager.o
-[AVCamCaptureManager captureStillImage] in AVCamCaptureManager.o
-[AVCamCaptureManager cameraCount] in AVCamCaptureManager.o
-[AVCamCaptureManager(InternalUtilityMethods) cameraWithPosition:] in AVCamCaptureManager.o
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
___27-[AVCamCaptureManager init]_block_invoke_0 in AVCamCaptureManager.o
-[AVCamCaptureManager captureStillImage] in AVCamCaptureManager.o
-[AVCamCaptureManager cameraCount] in AVCamCaptureManager.o
-[AVCamCaptureManager(InternalUtilityMethods) cameraWithPosition:] in AVCamCaptureManager.o
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_AVVideoCodecJPEG", referenziert von:
-[AVCamCaptureManager setupSession] in AVCamCaptureManager.o
"_AVVideoCodecKey", referenziert von:
-[AVCamCaptureManager setupSession] in AVCamCaptureManager.o
"_CMVideoFormatDescriptionGetCleanAperture", referenziert von:
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_OBJC_CLASS_$_AVCaptureVideoPreviewLayer", referenziert von:
objc-class-ref in AVCamViewController.o
"_AVLayerVideoGravityResize", referenziert von:
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_AVLayerVideoGravityResizeAspect", referenziert von:
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_AVLayerVideoGravityResizeAspectFill", referenziert von:
-[AVCamViewController viewDidLoad] in AVCamViewController.o
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_OBJC_CLASS_$_ALAssetsLibrary", referenziert von:
objc-class-ref in ImageViewController.o
ld: Symbol(e) nicht gefunden für Architektur i386
clang: Fehler: Linker-Befehl fehlgeschlagen mit Exit-Code 1 (Verwendung von -v zum Anzeigen des Aufrufs)
Vielen Dank im Voraus BEARBEITEN: Problem wurde gelöst. Einige Änderungen in den App-Einstellungen wie Änderung des Such-Header-Pfads usw.