ios5より前AVFoundationFrameworkが使用されていますが、ios5ストーリーボードでは機能しません。アプリケーション のようなリンクエラーが表示されます。 助けてください。どのフレームワークが使用されていますか?
以下の方法で、上位3または4のエラーが表示されます。事前に
- (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;
}
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_AVCaptureDeviceInput", referenced from:
objc-class-ref in AVCamCaptureManager.o
"_OBJC_CLASS_$_AVCaptureStillImageOutput", referenced from:
objc-class-ref in AVCamCaptureManager.o
"_OBJC_CLASS_$_AVCaptureSession", referenced from:
objc-class-ref in AVCamCaptureManager.o
"_OBJC_CLASS_$_AVCaptureDevice", referenced from:
objc-class-ref in AVCamCaptureManager.o
"_AVCaptureDeviceWasConnectedNotification", referenced from:
-[AVCamCaptureManager init] in AVCamCaptureManager.o
"_AVCaptureDeviceWasDisconnectedNotification", referenced from:
-[AVCamCaptureManager init] in AVCamCaptureManager.o
"_AVMediaTypeAudio", referenced from:
___27-[AVCamCaptureManager init]_block_invoke_0 in AVCamCaptureManager.o
-[AVCamCaptureManager micCount] in AVCamCaptureManager.o
-[AVCamCaptureManager(InternalUtilityMethods) audioDevice] in AVCamCaptureManager.o
"_AVMediaTypeVideo", referenced from:
___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", referenced from:
-[AVCamCaptureManager setupSession] in AVCamCaptureManager.o
"_AVVideoCodecKey", referenced from:
-[AVCamCaptureManager setupSession] in AVCamCaptureManager.o
"_CMVideoFormatDescriptionGetCleanAperture", referenced from:
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_OBJC_CLASS_$_AVCaptureVideoPreviewLayer", referenced from:
objc-class-ref in AVCamViewController.o
"_AVLayerVideoGravityResize", referenced from:
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_AVLayerVideoGravityResizeAspect", referenced from:
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_AVLayerVideoGravityResizeAspectFill", referenced from:
-[AVCamViewController viewDidLoad] in AVCamViewController.o
-[AVCamViewController(InternalMethods) convertToPointOfInterestFromViewCoordinates:] in AVCamViewController.o
"_OBJC_CLASS_$_ALAssetsLibrary", referenced from:
objc-class-ref in ImageViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
おかげ EDIT: 問題が解決されます。私にはなど
ターゲットクラスでプロジェクトおよびインポートに動作します。 – Diziet
ありがとう@Diziet私はできるだけ頻繁に自分の投稿を更新しようとする –