我是iphone的新开发人员,问题是我想知道sym.data的类型。是代码栏还是qrcode?

- (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;
}
}

最佳答案

sym.typeName是您想要的...

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


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

关于iphone - 如何使用zbar sdk知道结果类型(条形码或二维码)?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8257230/

10-12 19:36