iOS Question Panel click is working on debug not in release

Discussion in 'iOS Questions' started by Shay, Feb 14, 2015.

  1. Shay

    Shay Well-Known Member Licensed User

    This is working on debug mode

    class_global:
    private panel1 as panel

    Sub Panel1_Click
    PG.ResignFocus
    HD.ToastMessageShow ("pressed",False)
    End Sub

    not in release, why? (not even toast is displaying)
     
  2. stevel05

    stevel05 Expert Licensed User

    It works for me, what else do you have in the app?
     
  3. Shay

    Shay Well-Known Member Licensed User

    I just tested again, also the button is not responding, clicking on it - nothing happen
    only the TextFeilds are responding
    I am using class and not modules
    I am calling it like:
    dim mypage as myclassx
    mypage.initilize

    moved to classes since I had other issue which pages are not cleared (once coming back to it, all the data was still there) so Erel told me to switch to classes
     
  4. Shay

    Shay Well-Known Member Licensed User

    I replaced the panel and the button in the layout for new button/panel and now this issue also happen in debug mode, so the log I get is:
    Event target instance was released: panel1_click
    Event target instance was released: button1_click
     
  5. Shay

    Shay Well-Known Member Licensed User

    ...And now it is working on debug mode (changed the page in main to public), but again not in release mode
     
  6. stevel05

    stevel05 Expert Licensed User

    Can you post the project? Or one that shows the problem.
     
  7. Erel

    Erel Administrator Staff Member Licensed User

    These messages mean that the class instance that should handle the event was released because there were no live references pointing to it.

    Make this class instance a global variable to fix it.
     
  8. Shay

    Shay Well-Known Member Licensed User

    Please clarify
    you mean: sub global initialize?
    since page as public did not help
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    It is hard to answer without going over your code.

    You have created a class instance which should handle the layout events. You need to make sure that you keep a live reference to this class instance.

    iOS doesn't have a powerful garbage collector such as Android / Java. It uses a much simpler mechanism (reference counting). It is your responsibility to keep references to your class instances.
     
  10. Shay

    Shay Well-Known Member Licensed User

    I will try to explain my code, try to guide me (since only in the evening I can create some demo code)
    I have main module, in there I have the NAV as global and page as global
    other "pages" are in classes, code is copied from standard module (I just changed the sub name from "show" to "initialize"

    on the classes the page need to be public or private?
    is it need to be same name as page in main?

    let say the page I want to go called "registerC"
    so I do from main:
    dim register as registerC
    register.initilize
    <And here I have this issue>
    on register initialize sub, I am using main.nav.showpage
     
  11. Erel

    Erel Administrator Staff Member Licensed User

    The problem is with the register variable. Make it a global variable.
     
  12. Shay

    Shay Well-Known Member Licensed User

    Thanks, I created public vars on main for each class
    seems to solve the issue (still testing)
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice