iOS Question B4XPages in B4I (instance release)

fbritop

Active Member
Licensed User
Longtime User
I have done a small example with B4XPages, which runs like a charm in B4A, but in iOS I´m loosing events.

When I add a page, thenI have a sub which inits some components, in this case, it creates 3 menus, which are added each one to a CLV (listdata var)

B4X:
Sub Test
    Dim mnu As clsMenuItem
    mnu.Initialize(Me, "codeType")
    mnu.Title=("SMS")
    mnu.Tag="SMS"
    mnu.Generate
    listData.Add(mnu.GetBase,"")
    
    Dim mnu As clsMenuItem
    mnu.Initialize(Me, "codeType")
    mnu.Title=("WHATSAPP")
    mnu.Tag="WA"
    If Main.kvs.Get("whatsapp")<>"OK" Then
        mnu.settings="NO DISPONIBLE"
        mnu.Tag=""
    End If
    mnu.Generate
    listData.Add(mnu.GetBase,"")
    
    Dim mnu As clsMenuItem
    mnu.Initialize(Me, "codeType")
    mnu.Title=("TELEGRAM")
    mnu.Tag="TG"
    If Main.kvs.Get("telegram")<>"OK" Then
        mnu.settings="NO DISPONIBLE"
        mnu.Tag=""
    End If
    mnu.Generate
    listData.Add(mnu.GetBase,"")
End Sub

Sub codeType_Click(value As Object)
    Log(value)
End Sub

As I stated before, every time I click on each clsMenuItem object in B4A it logs out the value, but when the init sub is called in B4I, I can see the logs with 3 lines with:

Class (b4i_clsmenuitem) instance released.

After that, no event is received for the event that was init.

Is there anything I´m missing regarding B4I that could be a little diferent than B4A in what respect to Custom View Classes and B4XPages?
 
Top