0

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!

user1415780
  • 1,153
  • 5
  • 16
  • 33

1 Answers1

1

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

Monkeyanator
  • 1,346
  • 2
  • 14
  • 29
  • Basically I need to have the user scan several items (we are talking about thousands of items in a row) without having to dismiss the scan screen . I am thinking of adding a "Done Button" but even this I am not sure how it works .. – user1415780 Sep 28 '12 at 14:16
  • Thousands? Well, okay. Well, you could always manually add a done button. It's actually very easy. I'll edit my post to contain it. – Monkeyanator Sep 28 '12 at 14:25
  • Thank you for your help! one last question ( I am quite new to all this ) : will the code that you just added (the done button code) be inserted at the -(void) imagePickerController: (UIImagePickerController*) 'reader didFinishPickingMediaWithInfo: (NSDictionary*) info ' or where should it be in ? – user1415780 Sep 28 '12 at 15:04
  • Put the code in the view controller presenting the scanner. Make sure you put that code there before you actually present the controller. Alright, good luck :D – Monkeyanator Oct 02 '12 at 17:03