iOS Question Application tried to push a nil view controller on target <B4INavigationController: 0x176ab590>.

Discussion in 'iOS Questions' started by Ramezanpour, Mar 26, 2015.

  1. Ramezanpour

    Ramezanpour Active Member Licensed User

    Hi there

    I have problem with my app
    error (log):

    Application tried to push a nil view controller on target <B4INavigationController: 0x176ab590>.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Which line causes this error?
     
    Ramezanpour likes this.
  3. Ramezanpour

    Ramezanpour Active Member Licensed User

    page.RootPanel.LoadLayout("menu")
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Please post the full code or even better upload the project.
     
    Ramezanpour likes this.
  5. Ramezanpour

    Ramezanpour Active Member Licensed User

    Can i send it to your mail ?
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    I'm sorry but no.
     
  7. mtechteam

    mtechteam Member Licensed User

    Erel, I assume since the post ends where it does that the problem was never discussed more. We are having this same error with 2 projects that were B4A converted to B4i. We rename the offending view then the message goes away. It comes back when we add anything "major" such as new variables or much code. Then we rename the view and the error goes away again.

    Any assistance is appreciated. Will try to get a trimmed down copy of what we are doing made and see if the error continues so we can post it.
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the code that causes this warning?
     
  9. mtechteam

    mtechteam Member Licensed User

    Here is a sample of part of the offending code AND what we found the real issue is (at least it seems to have solved the problem thus far). When you have a code module that is named the same as a page view and you are running it in B4i you will, a majority of the time, get the the error this post was started with; while B4A seems to have no problem with the same name being used for both. What the interns working for us did was change the capitalization of the page name everywhere and it would work, for a little while, then had to change it back the other way for a while - they got a bit frustrated after a while. One of our other programmers doing a similar thing just changed the name to something completely different for the method and the problem has not been back since. So, the name "CheckList" below is used for both the module name and the page, which in B4A would never error, but would give us errors 50-90% of the time in B4i. If it matters, all of our code starts in B4A and gets converted to B4i.
    --------------------
    Code Module name: CheckinList

    Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'Public variables can be accessed from all modules.

    Public CheckinList As Page
    Public NavControl As NavigationController

    Dim lblDate As Label
    Dim lstCheckNames As ScrollView
    End Sub

    Sub Settings_Start (Nav As NavigationController)
    CheckinList.Initialize("Checkin")
    CheckinList.RootPanel.Color = Colors.White
    CheckinList.RootPanel.LoadLayout("checkin")

    NavControl = Nav
    NavControl.ShowPage(CheckinList)

    ArkCalls.DisplayDatelbl(lblDate)
    CheckinNameCalls.LoadCheckinList(lstCheckNames)

    End Sub
    ----------------------
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    You shouldn't use the module name as a variable name. I will add a check for this during parsing.
     
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