0
私はMTBBarcodeScanner
interfaceを使用してバーコードスキャナアプリケーションを実装しています。
私は私のコードでスキャナの静止画像を取得する必要があるので、私は関数を呼び出すしようとしています:IOSに呼び出しエラーが発生する関数
- (void)captureStillImage:(void (^)(UIImage *image, NSError *error))captureBlock {
if ([self isCapturingStillImage]) {
if (captureBlock) {
NSError *error = [NSError errorWithDomain:kErrorDomain
code:kErrorCodeStillImageCaptureInProgress
userInfo:@{NSLocalizedDescriptionKey : @"Still image capture is already in progress. Check with isCapturingStillImage"}];
captureBlock(nil, error);
}
return;
}
AVCaptureConnection *stillConnection = [self.stillImageOutput connectionWithMediaType:AVMediaTypeVideo];
if (stillConnection == nil) {
if (captureBlock) {
NSError *error = [NSError errorWithDomain:kErrorDomain
code:kErrorCodeSessionIsClosed
userInfo:@{NSLocalizedDescriptionKey : @"AVCaptureConnection is closed"}];
captureBlock(nil, error);
}
return;
}
[self.stillImageOutput captureStillImageAsynchronouslyFromConnection:stillConnection
completionHandler:^(CMSampleBufferRef imageDataSampleBuffer, NSError *error) {
if (error) {
captureBlock(nil, error);
return;
}
NSData *jpegData = [AVCaptureStillImageOutput jpegStillImageNSDataRepresentation:imageDataSampleBuffer];
UIImage *image = [UIImage imageWithData:jpegData];
if (captureBlock) {
captureBlock(image, nil);
}
}];
}
私のViewControllerから、私は次のようにこの関数を呼び出しています:
UIImage *img;
NSError *e;
[_scanner captureStillImage:img :e];
が、
No visible @interface for 'MTBBarcodeScanner' declares the selector 'captureStillImage::
どのように私は、この関数が私のUIViewcontroller
サブクラス呼び出すことができます。私にエラーを与えて?