I have a local sqlite database that I am accessing with no problems. I can create an archive with the database in the bundle, and copy and access it to various places.
I check if the file exists, if is does not, I copy it from the bundle and open it with no problems
This works fine running from Xcode
let fileURL = try! FileManager.default
.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
.appendingPathComponent(dbName)
if sqlite3_open_v2(fileURL.path, &db, SQLITE_OPEN_READWRITE, nil) == SQLITE_OK {
print(fileURL.path)
return
}
Now I archive the app and Copy App
I then copy the app to a usb drive
execute the app and it creates the file in the same place and runs fine.
Now...How do I take this to someone elses machine and run since my user will not be on their machine.
I have messed with other locations, and it is just like being back on Unix, all your problems have to do with permissions.
What is the standards for doing this? I am at my witts end:-(