Menu

Automatically scan in iOS3.x

iPhone App
insprie
2011-02-23
2013-02-02
  • insprie

    insprie - 2011-02-23

    I have it working in iOS4.x to automatically scan but on iOS3.x it does nothing, I'm using the following code

    //present a barcode reader that scans from the camera feed
        readerActive = YES;
        ZBarReaderViewController *reader = [ZBarReaderViewController new];
        reader.readerDelegate = self;
    
        UIImageView *overlayGraphicView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"corners.png"]];
        overlayGraphicView.frame = CGRectMake(30, 60, 260, 310);
        reader.cameraOverlayView = overlayGraphicView;
        [overlayGraphicView release];
        reader.showsZBarControls = NO;
    
        ZBarImageScanner *scanner = reader.scanner;
        //disable rarely used I2/5 to improve performance
        [scanner setSymbology: ZBAR_I25
                       config: ZBAR_CFG_ENABLE
                           to: 0];
    
        if (![reader.view superview])
            [scannerView addSubview:reader.view];
    

    I don't want to add a manual scan button and apparrently by default it automatically scans but under iOS3.x it does not. NB it has been weak linked.

    Any ideas?

     
  • insprie

    insprie - 2011-02-23

    This should be in the developer's section.

     
  • spadix

    spadix - 2011-02-25

    > I don't want to add a manual scan button … under iOS3.x

    You need to read the chapter in the SDK docs about Backward Compatibility; I believe that everything you ask here is answered there…

     

Log in to post a comment.