English 中文(简体)
ZBAR SDK问题。
原标题:ZBAR iPhone SDK issue.

我有一 app用Zbar SDK I, 一切照旧,而且大刀切。 然而,当我试图扫描UPC-A条条码时(Grocery 只字),其编号与条码完全不同。

For example: I scan 03800051156 I get as a result: 156749328

你可以看到完全不同!

- (IBAction)scanButtonTapped
{
    // ADD: present a barcode reader that scans from the camera feed
    ZBarReaderViewController *reader = [ZBarReaderViewController new];
    reader.readerDelegate = self;

    ZBarImageScanner *scanner = reader.scanner;
    // TODO: (optional) additional reader configuration here

    // EXAMPLE: Set UPC-A
    [scanner setSymbology: ZBAR_UPCA
                   config: ZBAR_CFG_ENABLE
                       to: 1];

    // present and release the controller
    [self presentModalViewController: reader
                            animated: YES];
    [reader release];
}


- (void) imagePickerController: (UIImagePickerController*) reader
 didFinishPickingMediaWithInfo: (NSDictionary*) info
{
    // ADD: get the decode results
    id<NSFastEnumeration> results =
    [info objectForKey: ZBarReaderControllerResults];
    ZBarSymbol *symbol = nil;
    for(symbol in results)
        // EXAMPLE: just grab the first barcode
        break;

    //URL
    NSString *urlString = symbol.data;
    NSURL *url = [NSURL URLWithString:urlString];
    [scanWebView loadRequest:[NSURLRequest requestWithURL:url]];

    NSLog(@"Type UPC %d", symbol.type);

    NSLog(@"Reader UPC %d", urlString);
    AppDataObject* theDataObject = [self theAppDataObject];
    theDataObject.UPC = urlString;

    // EXAMPLE: do something useful with the barcode data
    resultText.text = symbol.data;
    // ADD: dismiss the controller (NB dismiss from the *reader*!)
    [reader dismissModalViewControllerAnimated: YES];

    // ADD Load the ProductInfo view after a slight delay to let the other VC resign. 
    [self performSelector:@selector(loadProduct) withObject:nil afterDelay:1.0];
}
最佳回答

页: 1

Try:

NSLog(@"Reader UPC %@", urlString);
问题回答

暂无回答




相关问题
Code sign Error

I have created a new iPhone application.I have two mach machines. I have created the certificate for running application in iPhone in one mac. Can I use the other mac for running the application in ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

将音频Clips从Peter改为服务器

我不禁要问,那里是否有任何实例表明从Peit向服务器发送音响。 I m不关心电话或SIP风格的解决办法,只是一个简单的袖珍流程......

• 如何将搜查线重新定位?

我正试图把图像放在搜索条左边。 但是,问题始于这里,搜索条线不能重新布署。

热门标签