Menu

#364 Application is crashing after including a screen for QRCode Reading?

fixed
None
Bug
2015-11-25
2015-11-23
No

In my application I have two Screen. First screen is having some text fields and buttons and the second screen is holding a TDPFBarCodeReader. Through a button on the first screen I am presenting the second screen and when I dismiss the second screen than after clicking any of the text fields of the first screen the application crashes. This problem is because of the TDPFQRCodeReader of the second screen. Why it is happening bcz of the QR code reader and how I can resolve it plz?

Discussion

  • Shujaat Hussain

    Shujaat Hussain - 2015-11-23

    These are the screen shots of the mentioned screens

     
  • Detlef Heibing

    Detlef Heibing - 2015-11-24

    I have got the same problem. Simple way to reproduce: open the demo "barcode" and change the line
    DPFLabel1.Text := AText;
    to
    ShowMessage(AText);
    App crashes immediately on iOS 9 (tested with Delphi XE8 and Delphi 10 Seattle).

     
  • Sebastian Zierer

    The issue comes from the following code in DPF.iOS.ApplicationManager, where I'm trying to get the viewDidAppear event. Unfortunately we still don't get that event without a hack. Feel free to vote for https://quality.embarcadero.com/browse/RSP-9883 ;-)

    As a quick workaround you have to either link against the iOS 8 framework or comment out the following lines in DPF.iOS.ApplicationManager.

        //SZ: this makes the application crash when compiled in DX10
        M1 := class_getInstanceMethod( ViewClass, sel_getUid( 'viewDidAppear:' ) );
        M2 := class_getInstanceMethod( ViewClass, sel_getUid( 'viewDidAppearOriginal:' ) );
        method_exchangeImplementations( M1, M2 );
    
     

    Last edit: Sebastian Zierer 2015-11-24
  • Detlef Heibing

    Detlef Heibing - 2015-11-25

    Tested... works! Thank you for your quick reply.

     
  • Shujaat Hussain

    Shujaat Hussain - 2015-11-25

    Thanks Sabastian, I commented out the mentioned lines. Tested and it's working now. I can scan QR Code through it. Is thr a way scan a Bar code(code128) using this component? I have already created a ticket regarding this request https://sourceforge.net/p/dpfdelphiios/tickets/363/

     
  • Detlef Heibing

    Detlef Heibing - 2015-11-25

    Within the method TCaptureDelegate.captureOutput there is a line

    if metadata.&type.isEqualToString( AVMetadataObjectTypeQRCode ) then
    

    which checks if the scanned code is QR or not ;)

     
  • Shujaat Hussain

    Shujaat Hussain - 2015-11-25

    Thanks :) How to update that method for the Bar Code?

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2015-11-25

    Hi

    Fixed
    Thank you for feedback,
    Please download last source code from SVN section
    https://sourceforge.net/p/dpfdelphiios/code/

    Regards

     
  • Shujaat Hussain

    Shujaat Hussain - 2015-11-25

    Babak, can you please guide me through Bar Code Scannig?

     
  • Shujaat Hussain

    Shujaat Hussain - 2015-11-25

    Ok I did it. Thanks Detlef and Babak

     
  • Babak Yaghoobi

    Babak Yaghoobi - 2015-11-25
    • status: open --> fixed
     

Log in to post a comment.