Search code examples
objective-ciosxcode4.5zbar-sdk

zbar batch QR code scanning


I am currently using ZBar to scan QR codes using the steps documented on their website

my question is , is there a way to modify these steps to do a batch scan (i.e. scan several QR codes , store them in an NSMutableArray without dismissing the scanner)?

Thanks!


Solution

  • The view controller doesn't dismiss until you dismiss it. It doesn't actually go away until you make the call :

    [scanner dismissModalViewControllerAnimated:YES]; 
    

    What specific project would you have in mind? I'm hesistant to write code for and have it be the complete wrong code for the complete wrong thing.

    And as for the NSMutable array thing, absolutely. That should be no problem at all. To add the done button, implement the following code :

    UIBarButtonItem *doneButton = [[UIBarButtonItem alloc] init]; 
    [doneButton setTarget:self]; 
    doneButton.title = @"Done"; 
    [doneButton setAction:@selector(dismissViewController)]; //put the dismissal procedure method where dismiss view controller is
    self.navigationItem.rightBarButtonItem = doneButton; 
    

    If you wanted, xCode now has a built in done button feature as well :P