Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 我正在应用程序中使用Zxing库_Ios_Objective C_Ios8_Zxing - Fatal编程技术网

Ios 我正在应用程序中使用Zxing库

Ios 我正在应用程序中使用Zxing库,ios,objective-c,ios8,zxing,Ios,Objective C,Ios8,Zxing,我停止了相机,我使用下面的方法它的作品罚款 - (void)viewDidLoad { self.capture = nil; self.capture = [[ZXCapture alloc] init]; self.capture.camera = self.capture.back; self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;

我停止了相机,我使用下面的方法它的作品罚款

 - (void)viewDidLoad
    {

        self.capture = nil;
        self.capture = [[ZXCapture alloc] init];
        self.capture.camera = self.capture.back;
        self.capture.focusMode = AVCaptureFocusModeContinuousAutoFocus;
        self.capture.rotation = 90.0f;

        self.capture.layer.frame = CGRectMake(0, 150, self.view.frame.size.width,            self.view.frame.size.height);
        self.capture.delegate = self;
        [self.view.layer addSublayer:self.capture.layer];
        [self.capture start];
    }
我正在尝试启动相机,我使用以下方法

[self.capture stop];
上述方法不起作用,无法打开相机进行扫描

请帮忙
提前感谢。

不要使用ZXing,iOS7支持条形码扫描()

请移动开始方法视图。它似乎对我很好

[self.capture start];

stop方法的源代码已经过验证

- (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
        [self.capture start];
    }
该层将从self.view.layer中删除,因此在开始方法中,再次添加该层,并将自定义视图放在前面

[self.layer removeFromSuperlayer];

您是否分配了多次?是否能够扫描PDF417格式的所有驾照?我在一个许可证上测试了它,效果很好。是的,你不需要导入一个库,它直接由苹果支持。
[self.view.layer addSublayer:self.capture.layer];
[self.view bringSubviewToFront:self.startButton];
[self.capture start];