title: Zbar sdk scanner not working properly
body: <p>In my application i have integrated Zbar SDK scanner, while scanning usually its working fine but my case is some times didfinishpickingmediawithInfo: delegate method firing twice. Here is my code which is in a singletone class.</p>
  
  <pre><code>-(void)scanProductBarCode
  {
  
          ZBarReaderViewController *reader = [ZBarReaderViewController new];
          reader.readerDelegate = self;
  
  
          if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
              reader.supportedOrientationsMask = ZBarOrientationMaskLandscape;
          else
              reader.supportedOrientationsMask = ZBarOrientationMaskPortrait;
  
          ZBarImageScanner *scanner = reader.scanner;
          [scanner setSymbology: ZBAR_UPCA config: ZBAR_CFG_ENABLE to: 1];
          [scanner setSymbology: ZBAR_CODE39 config: ZBAR_CFG_ADD_CHECK to: 0];
  
  
  }
  
  #pragma mark - Scanner delegate methods
  
  - (void) imagePickerController: (UIImagePickerController*) reader didFinishPickingMediaWithInfo: (NSDictionary*) info
  {
      id&lt;NSFastEnumeration&gt; results = [info objectForKey: ZBarReaderControllerResults];
      ZBarSymbol *symbol = nil;
      for(symbol in results)
          break;
  
      barCodeString = [[NSString alloc] initWithString:symbol.data];
  
      if(self.delegate)
          [self.delegate getBarcodeString:barCodeString];
  
      [reader dismissModalViewControllerAnimated:YES];
  
  
  }
  </code></pre>
  
  <p>See this screen shot:</p>
  
  <p><img src="https://i.stack.imgur.com/iajsQ.jpg" alt="enter image description here"></p>
  
  <p>At background the scanner is still running like this in twice occuring case..</p>