iOS Question B4i - Sqlite

daniedb

Active Member
Licensed User
Hi Guys
This got me puzzling for the last 2 hours, and can get it sorted

In my one B4i App this works 100%

B4X:
 Dim localdb As String  :localdb="gsm/data/gsm.db"
  File.MakeDir(File.DirDocuments,"gsm/data")
   If File.Exists(File.DirDocuments,"gsm/data/gsm.db") = False Then
     File.Copy(File.DirAssets,"gsm.db",File.DirDocuments,localdb)
     Log("cannot find db, copy")
   Else
     Log("find db, ")
   End If
In a second app, it don't work

B4X:
Dim localdb As String  :localdb="MyApp/data/wlife.db"
  File.MakeDir(File.DirDocuments,"MyApp/data")

   If File.Exists(File.DirDocuments,"MyApp/data/wlife.db") = False Then
     File.Copy(File.DirAssets,"wlife.db",File.DirDocuments,localdb)
     Log("cannot find db, copy")
   Else
     Log("find db, ")
   End If
Ive confirmed that the wlife.db is in the files folder of this project

B4X:
Error copying file: Error Domain=NSCocoaErrorDomain Code=4 "The operation couldn’t be completed. (Cocoa error 4.)" UserInfo=0x165f20a0 {NSSourceFilePathErrorKey=/private/var/mobile/Applications/65FD4191-E26F-4080-8EB4-DBF25AC201F8/tmp/virtual_assets/wlife.db, NSUserStringVariant=(
  Copy
), NSFilePath=/private/var/mobile/Applications/65FD4191-E26F-4080-8EB4-DBF25AC201F8/tmp/virtual_assets/wlife.db, NSDestinationFilePath=/var/mobile/Applications/65FD4191-E26F-4080-8EB4-DBF25AC201F8/Documents/leznad/wildMang/data/wlife.db, NSUnderlyingError=0x165f18c0 "The operation couldn’t be completed. No such file or
Please advice, thanks, Appreciate
Danie
 

daniedb

Active Member
Licensed User
Ok, this is now starts to freak me out :)
3Rd Time a Post a Question, after struggling for a few hours, and once posted, I see something and change it
<solved, HOW>
I've changed the paths to lowercase and it works.
Never realize that Apple require lower case..

Maybe someone else learn out of my stupid mistakes...

Cherio
D
 
Top