iOS Question Local DB crash on IOS 8

Discussion in 'iOS Questions' started by Shay, Feb 24, 2015.

  1. Shay

    Shay Well-Known Member Licensed 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

    Code:
    Sub Msg_Click(ButtonText As String)

        
    If ButtonText="yes" Then
         WriteToFavorite
        
    Else
         Register
        
    End If
       
    End Sub
    Code:
    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
     
  2. omidaghakhani1368

    omidaghakhani1368 Well-Known Member Licensed User

    Hi.
    Do you have any log?
     
  3. Erel

    Erel Administrator Staff Member Licensed User

    Never build queries like this. You should use ExecQuery2 and ExecNonQuery2 and put all the variables in an array. Otherwise the query may be invalid if there is a character that needs to be escaped.
     
  4. Shay

    Shay Well-Known Member Licensed 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?
     
  5. Erel

    Erel Administrator Staff Member Licensed User

    Why do you need Apple to approve the build? Add the device to your Apple account and install it directly.

    If you are unable to reproduce the crash then there isn't much that can be done.
     
  6. Shay

    Shay Well-Known Member Licensed 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
     
  7. Shay

    Shay Well-Known Member Licensed User

    Found the issue, it was php response issue
    not related to IOS
     
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