iOS Question iTabstrip signal - 11 crash when setting pages

Discussion in 'iOS Questions' started by Sviluppatori Liceo Giovio, Apr 6, 2019.

  1. Sviluppatori Liceo Giovio

    Sviluppatori Liceo Giovio Member Licensed User

    I'm using a tabstrip contained within a panel which I'm removing and then re-adding. Every time the panel is added again after being removed I define the pages again, load their layouts and add them to the tabstrip.

    I have tested this exact setup on a smaller project and it works fine (attached to this post). But on my main project it crashes with the following message:

    Code:
    SignalHandler 11
    Error occurred on line: 
    1758 (Main)
    Signal - 
    11
    Stack Trace: (
        
    "0   InfoGiovio           SignalHandler + 112",
        
    "1   libsystem_platform.dylib            0x1af88251 _sigtramp + 16",
        
    "2   UIKit                <redacted> + 66",
        
    "3   UIKit                <redacted> + 56",
        
    "4   InfoGiovio           -[XLButtonBarView moveFromIndex:toIndex:withProgressPercentage:pagerScroll:] + 140",
        
    "5   InfoGiovio           -[XLButtonBarPagerTabStripViewController pagerTabStripViewController:updateIndicatorFromIndex:toIndex:withProgressPercentage:indexWasChanged:] + 120",
        
    "6   InfoGiovio           -[B4IPagerTabStrip pagerTabStripViewController:updateIndicatorFromIndex:toIndex:withProgressPercentage:indexWasChanged:] + 80",
        
    "7   InfoGiovio           -[XLPagerTabStripViewController updateContent] + 1634",
        
    "8   InfoGiovio           -[XLPagerTabStripViewController reloadPagerTabStripView] + 730",
        
    "9   InfoGiovio           -[XLButtonBarPagerTabStripViewController reloadPagerTabStripView] + 62"
    )
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    If I remember correctly, this error can happen when you show a TabStrip with no pages. Make sure to always add at least one page.
     
  3. Sviluppatori Liceo Giovio

    Sviluppatori Liceo Giovio Member Licensed User

    Code:
    Sub TabStripSetup
     
      

        
    Dim TabPages As List
        TabPages.Initialize
        
    Dim cs As CSBuilder
        
    Dim TutteP,StudentiP,GenitoriP,InsegnantiP As Page
      
        TutteP.Initialize(
    "TutteP")
        TutteP.RootPanel.LoadLayout(
    "Tutte")
        SetAttributedTitle(TutteP,cs.Initialize.Color(
    Colors.White). Append("Tutte").PopAll)
          
        TabPages.Add(TutteP)
      
        StudentiP.Initialize(
    "StudentiP")
        StudentiP.RootPanel.LoadLayout(
    "Studenti")
        SetAttributedTitle(StudentiP,cs.Initialize.Color(
    Colors.White).Append("Studenti").PopAll)

        TabPages.Add(StudentiP)
      
        GenitoriP.Initialize(
    "GenitoriP")
        GenitoriP.RootPanel.LoadLayout(
    "Genitori")
        SetAttributedTitle(GenitoriP,cs.Initialize.Color(
    Colors.White).Append("Genitori").PopAll)

        TabPages.Add(GenitoriP)
      
      
        
    If LoginCheck Then
      
            InsegnantiP.Initialize(
    "InsegnantiP")
            InsegnantiP.RootPanel.LoadLayout(
    "Insegnanti")
            SetAttributedTitle(InsegnantiP,cs.Initialize.Color(
    Colors.White).Append("Insegnanti").PopAll)
            TabPages.Add(InsegnantiP)
     
            InsegnantiListView.AsView.Tag = 
    2
            InsegnantiListView.AnimationDuration = 
    0
        
    End If
      

        TabStrip1.SetPages(TabPages)
      
        StudentiListView.AsView.Tag = 
    0
        GenitoriListView.AsView.Tag = 
    1
        TutteListView.AsView.Tag = 
    3
      
        TopPanel = xui.CreatePanel(
    "")

        TopPanel.SetLayoutAnimated(
    000, MainPage.RootPanel.Width, 70dip)
      
        TopPanel.LoadLayout(
    "top")
      
        StudentiListView.AnimationDuration = 
    0
        GenitoriListView.AnimationDuration = 
    0
        TutteListView.AnimationDuration = 
    0
      
      
      
    End Sub

    This sub handles setting up the tabstrip. It's called both when first loading the application and when re-creating the tabstrip, so there are no differences between when it works and when it doesn't (at least in terms of what pages are being loaded).
     
    Last edited: Apr 7, 2019
  4. Erel

    Erel Administrator Staff Member Licensed User

    Are you creating a new TabStrip each time?
     
  5. Sviluppatori Liceo Giovio

    Sviluppatori Liceo Giovio Member Licensed User

    The tabstrip is defined via the designer in a layout file.

    I'm loading this layout into a panel, destroying the panel, recreating the panel and re-loading the layout. Not sure if that counts as creating a new tabstrip.
    This works in the example project I attached to the original post, but in the main application it crashes.
     
    Last edited: Apr 8, 2019
  6. Erel

    Erel Administrator Staff Member Licensed User

    Is it easy to reproduce with your project? Can you upload it?
     
  7. Sviluppatori Liceo Giovio

    Sviluppatori Liceo Giovio Member Licensed User

    Yes, it can be reproduced easily. Just open up the side menu and press one of the bottom two buttons. This will switch out the panel. Then press the first one to go back to the initial layout. (Note: The first time the app starts it will download a couple files so it will load for a sec).

    The file is too large so here is a link: https://u.teknik.io/3XmhK.zip
     
  8. Erel

    Erel Administrator Staff Member Licensed User

    The third button causes a crash due to a missing file.

    I pressed on the login button and then on the first button multiple times. It worked properly.

    BTW, why aren't you reusing the layout? No need to create a new TabStrip each time.
     
  9. Sviluppatori Liceo Giovio

    Sviluppatori Liceo Giovio Member Licensed User

    I'm not sure as to why the third button causes a crash, perhaps I uploaded the project wrong.
    As for pressing the login and going back that's...strange. It crashes completely on my device (iPhone 6).

    How would I go about reusing the layout? Simply load it again? Wouldn't I still need to repopulate it? I'm destroying then recreating it in order to have as few objects "loaded" as possible.
    Not only that but I still need to destroy it and then recreate it following a login in order to add an additional page, so I still need to figure out what the issue is.
     
  10. Erel

    Erel Administrator Staff Member Licensed User

    Sounds like a mistake. Just hide the panel and show it later when needed.
     
  11. Sviluppatori Liceo Giovio

    Sviluppatori Liceo Giovio Member Licensed User

    Alright, I'll make sure to do that. I still have the other issue however.
     
  12. Erel

    Erel Administrator Staff Member Licensed User

    As I wrote, I wasn't able to reproduce it so cannot help you more.

    I guess that once you switch to reusing the TabStrip it will be resolved. If not then you will need to debug it until you find what causes it to crash.
     
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