Note that there are some explanatory texts on larger screens.

plurals
  1. POUnable to dismiss ZBarReaderViewController in imagePickerController didFinishPickingMediaWithInfo
    primarykey
    data
    text
    <p>Hi I'm developing a QR code reader app and having so much trouble when dismissing the ZBarReaderViewController. I have a view controller with a button which creates the reader and presents it.</p> <pre><code>- (IBAction)scanAction:(id)sender { ZBarReaderViewController *reader = [ZBarReaderViewController new]; reader.readerDelegate = self; [reader.scanner setSymbology: ZBAR_I25 config: ZBAR_CFG_ENABLE to: 0]; reader.readerView.zoom = 1.0; // [self presentViewController:reader animated:YES completion:nil]; [self presentModalViewController:reader animated:YES]; } </code></pre> <p>Then on the reader's delegate I'm doing this (I commented the results processing lines but I still get the same error):</p> <pre><code>- (void) imagePickerController: (UIImagePickerController*) reader didFinishPickingMediaWithInfo: (NSDictionary*) info { // id&lt;NSFastEnumeration&gt; results = [info objectForKey: ZBarReaderControllerResults]; // // ZBarSymbol *symbol = nil; // NSURL *url; // NSString * textUrl; // // for(symbol in results){ // textUrl = symbol.data; // NSLog(@"%@",textUrl); // url = [NSURL URLWithString:textUrl]; // break; // } // // if (url != nil) { //// NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //// [self.webView loadRequest:requestObj]; // [self.urlLabel setText:textUrl]; // } // [reader dismissViewControllerAnimated:NO completion:nil]; [reader dismissModalViewControllerAnimated:YES]; } </code></pre> <p>and this is the error I get randomly:</p> <pre><code>QR reader[10159:907] Warning: Attempt to dismiss from view controller &lt;ViewController: 0x1ed4c930&gt; while a presentation or dismiss is in progress! </code></pre> <p>Sometimes it scans and dismiss without any warning but when I get that warning the reader stays scanning, and the delegate gets called again until no more warnings are showed.</p> <p>I tried some suggestions from other users having the same problem but it won't work in my particular case:</p> <ol> <li>using dismissModalViewController instead of modal view which is deprecated. </li> <li>sorrounding the results processing in the completion block of the dismissViewControllerAnimated method.</li> </ol> <p>Thanks for reading :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload