【问题标题】:how to know the result type(barcode or qrcode) using zbar sdk?如何使用 zbar sdk 知道结果类型(条形码或二维码)?
【发布时间】:2012-01-05 15:11:21
【问题描述】:

我是新的 iphone 开发人员,问题是我想知道 sym.data 的类型。是codebar还是qrcode?​​p>

- (void) readerView: (ZBarReaderView*) view
 didReadSymbols: (ZBarSymbolSet*) syms
      fromImage: (UIImage*) img 
{
//do something useful with results and display resultText in resultViewController
for(ZBarSymbol *sym in syms) {
    imageResult3.image = img; 
    **resultText3.text = sym.data;**  
    //return resultText;
                   break;
}
}

【问题讨论】:

    标签: iphone objective-c barcode qr-code


    【解决方案1】:

    sym.typeName 就是你想要的...

        resultText.text = sym.typeName;
        resultText.text =  [ resultText.text stringByAppendingString:@" - " ];
        resultText.text =  [ resultText.text stringByAppendingString:sym.data ];
    

    在 ZBarSymbol 类参考中查看 ZBar 文档。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-05-19
      相关资源
      最近更新 更多