iOS Question Local DB crash on IOS 8

Shay

Well-Known Member
Licensed User
Longtime User
I have strange issue
the following code, works fine on my iphone 4 with ios 7
and crashes on iphone 5 with ios 8
1. Why?
2. How can I get some data on the crash, I got nothing (meaning they guy show me app is closing and no output on screen)

since this happen while he press "yes" and does not happen while he press "no" I am assuming this is related to local db

B4X:
Sub Msg_Click(ButtonText As String)

    If ButtonText="yes" Then
     WriteToFavorite
    Else
     Register
    End If
   
End Sub

B4X:
Sub WriteToFavorite

    HD.ProgressDialogShow("writing data")
    Dim Cursor1 As ResultSet
   
    If Not(File.Exists(File.DirDocuments,"My.db")) Then
     File.Copy(File.DirAssets,"My.db",File.DirDocuments,"My.db")
    End If

    If SQL1.IsInitialized = False Then
     SQL1.Initialize(File.DirDocuments,"My.db", False)
    End If
   
    Cursor1 = SQL1.ExecQuery("SELECT * FROM Favorite WHERE CustomerPhone='" & Main.CustomerPhone & "'")
    If Cursor1.NextRow Then
     HD.ToastMessageShow ("already exist",False)
    Else
     SQL1.ExecNonQuery("INSERT INTO Favorite (CustomerName, CustomerName2, City, Street, Number, AptNum, Floor, ContactPerson, CustomerPhone, Email, Lat, Lon) VALUES ('" & Main.CustomerName & "','" & Main.CustomerName2 & "','" & Main.City & "','" & Main.Street & "','" & Main.Number & "','" & Main.AptNum & "','" & Main.Floor1 & "','" & Main.ContactPerson & "','" & Main.CustomerPhone & "','" & Main.Email1 & "','" & Main.Lat & "','" & Main.Lon & "')")
    End If
   
    Register
   
End Sub
 

Shay

Well-Known Member
Licensed User
Longtime User
I haven't tested the ExecQuery2 yet, since it takes few days till Apple approve the build
but I just installed bridge on this guy phone with the old code (without the ExecQuery2 changes)
and in debug mode it is not crashing (did not try release mode yet, but on my phone I have no issue with release mode)
any suggestions?
 
Upvote 0

Shay

Well-Known Member
Licensed User
Longtime User
Since this is not my phone, I don't have access to it
they guy came to me do I can debug this issue, but issue is not reproducing in debug mode
I will try some more testing
 
Upvote 0
Top