Iphone ZBarCode阅读器有时在iOS中显示错误的扫描数据

Iphone ZBarCode阅读器有时在iOS中显示错误的扫描数据,iphone,ios,sdk,Iphone,Ios,Sdk,我在iPhone中使用ZBarCode阅读器时遇到了一个小问题,我已经实现了ZBarCode,它正在成功工作,但有时它通常在扫描条形码后在开始时添加一个整数值0,因此有时结果不准确,如果我做错了什么,请告诉我。你能发布你正在使用的代码吗?也许你用的是旧的参考书?在解析新扫描数据之前,请确保所有参考都指向零值。对于条形码和二维码扫描,我已经创建了完整详细的教程并发布了示例代码。每次都能给我完美的信息 这是核心逻辑 这样开始扫描方法体 - (IBAction)startScanning:(id)s

我在iPhone中使用ZBarCode阅读器时遇到了一个小问题,我已经实现了ZBarCode,它正在成功工作,但有时它通常在扫描条形码后在开始时添加一个整数值0,因此有时结果不准确,如果我做错了什么,请告诉我。

你能发布你正在使用的代码吗?也许你用的是旧的参考书?在解析新扫描数据之前,请确保所有参考都指向零值。

对于条形码和二维码扫描,我已经创建了完整详细的教程并发布了示例代码。每次都能给我完美的信息

这是核心逻辑

这样开始扫描方法体

- (IBAction)startScanning:(id)sender {

    NSLog(@"Scanning..");    
    resultTextView.text = @"Scanning..";

    ZBarReaderViewController *codeReader = [ZBarReaderViewController new];
    codeReader.readerDelegate=self;
    codeReader.supportedOrientationsMask = ZBarOrientationMaskAll;

    ZBarImageScanner *scanner = codeReader.scanner;
    [scanner setSymbology: ZBAR_I25 config: ZBAR_CFG_ENABLE to: 0];

    [self presentViewController:codeReader animated:YES completion:nil];    

}
实现ZBar的委托方法

- (void) imagePickerController: (UIImagePickerController*) reader didFinishPickingMediaWithInfo: (NSDictionary*) info
{
    //  get the decode results
    id<NSFastEnumeration> results = [info objectForKey: ZBarReaderControllerResults];

    ZBarSymbol *symbol = nil;
    for(symbol in results)
        // just grab the first barcode
        break;

    // showing the result on textview
    resultTextView.text = symbol.data;    

    resultImageView.image = [info objectForKey: UIImagePickerControllerOriginalImage];

    // dismiss the controller 
    [reader dismissViewControllerAnimated:YES completion:nil];
}
-(void)imagePickerController:(UIImagePickerController*)读卡器已使用信息完成PickingMediaWithInfo:(NSDictionary*)信息
{
//获取解码结果
id结果=[info objectForKey:ZBarReaderControllerResults];
ZBarSymbol*符号=nil;
用于(结果中的符号)
//只要抓取第一个条形码
打破
//在textview上显示结果
resultTextView.text=symbol.data;
resultImageView.image=[info-objectForKey:UIImagePickerControllerOriginalImage];
//解雇控制员
[reader DismissViewControllerInitiated:YES completion:nil];
}

ZBarReaderViewController*读卡器=[[ZBarReaderViewController alloc]init];reader.readerDelegate=self;reader.tracksSymbols=是;reader.supportedOrientationMask=zBaroOrientationMaskall;ZBarImageScanner*scanner=reader.scanner;[扫描仪设置符号:ZBAR_I25配置:ZBAR_CFG_启用:1];[self.navigationController presentViewController:reader-animated:YES-completion:nil];[读者发布];每当我使用它的时候,我都没有发现这样的问题。你仍然可以问同样的问题来支持我。