iOS Question [Solved] Code not working above iPhone 4

Descartex

Well-Known Member
Licensed User
Longtime User
Hi,
I´ve an app that i test on my iPhone 4 and it runs fine.
The problem comes with newer versions, as i can try on real devices, on iPhone 6, 7,8 and X it does not works as it should.
On runtime, i create a panel and on Tag property I put a map with relevant data for the app, when user clicks on it, map is not initialized:
B4X:
Sub Partido_Click
    Dim pnl As Panel
    pnl=Sender
    Log(pnl.Tag)
    Variables.PartidoActual=pnl.Tag
    If Variables.PartidoActual.IsInitialized Then
        Partido.Show
    Else
        Msgbox("No se puede cargar el partido en este momento, intente mas tarde","Error")
    End If
End Sub

What I'm doing wrong?
Regards.
 

JanPRO

Well-Known Member
Licensed User
Longtime User
Hi,
if the Tag value is Null, the PartidoActual object has no IsInitialized method, so your if condition is useless. It's better to check whether the Tag property is a map:

B4X:
Sub Partido_Click
   Dim pnl As Panel = Sender
   
   If pnl.Tag Is Map Then
       Variables.PartidoActual=pnl.Tag
       If Variables.PartidoActual.IsInitialized Then
           Partido.Show
       End If
   Else
       Msgbox("No se puede cargar el partido en este momento, intente mas tarde","Error")
   End If
End Sub

Jan
 
Last edited:
Upvote 0

Descartex

Well-Known Member
Licensed User
Longtime User
Yes, you are right.
But it doesn't explain why it works on iPhone 4 and fails on newer devices...
Same code, different behaviour
Weird...
 
Upvote 0

Descartex

Well-Known Member
Licensed User
Longtime User
Sure, can i email it?
 
Upvote 0

Descartex

Well-Known Member
Licensed User
Longtime User
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…