iOS Question Debugging skipping page_resize

Discussion in 'iOS Questions' started by MotoMusher, Mar 2, 2015.

  1. MotoMusher

    MotoMusher Active Member Licensed User

    Not sure if anyone else is seeing this but wanted to report it. When creating pages with only dynamic elements, the _resize sub doesn't fire. If I place a break and step through each line, it works, but not without a break. Building release app, it works perfectly, just via debugger there is an issue. I have experienced this in a few different b4i projects.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Please use Log to print a message from this sub and check whether it fires or not.
     
  3. MotoMusher

    MotoMusher Active Member Licensed User

    Yes, I had tried that and it does not fire in resize. If I don't have a debugging break in both "Launch" and "Settings_Resize" (in Settings) and step through line by line, I get a notification in the debug log window that states "Application tried to push a nil view controller on target <UINavigationController: 0x16e6f700>."

    If I step, it works fine, and it always works fine in release build.

    Sample project attached. I have tested on Windows server 2008r2, as well as Windows 8.1 with the same results.
     

    Attached Files:

  4. Erel

    Erel Administrator Staff Member Licensed User

    There is no relation between the windows version and the compiled app.

    I've added this line: Log("Page1_resize") to Page1_Resize and ran your app without adding any breakpoint.

    The message was logged.

    Note that this is not the recommended way to manage the user interface. You should use the designer features to create and resize the layout.
    Call View.SetLayoutAnimated if you want to update the size and position of a view.
     
  5. MotoMusher

    MotoMusher Active Member Licensed User

    My apologies. Page1 always works fine. It's when I call "Settings" that the issue occurs. To launch that page, click on the word "Settings" in the top left corner of the home screen.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    It is a mistake to name a variable with the same name as a module. Try to change it to SettingsPage and see whether it happens or not.
     
  7. MotoMusher

    MotoMusher Active Member Licensed User

    I thought that was requirement since that is how the main page in a new project is shipped. I just changed the following, and receive the same Nil view controller error.

    Settings.Initialize("SettingsX")


    Private Sub SettingsX_Resize(Width As Int, height As Int)
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    That is incorrect.

    You need to change the variable name. Not the event name parameter.
     
  9. MotoMusher

    MotoMusher Active Member Licensed User

    Thanks Erel. That did it. Sorry for the confusion.
     
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