Ошибка инициализации базы данных SQLite, расположенной в моей домашней папкеIOS

Программируем под IOS
Гость
Ошибка инициализации базы данных SQLite, расположенной в моей домашней папке

Сообщение Гость »


При попытке подключения к базе данных я получаю следующую ошибку. Я предоставил все разрешения всем пользователям на моем компьютере. Нужно ли мне что-то еще сделать в Xcode?

Ошибка инициализации базы данных SQLite: операцию не удалось завершить. (Ошибка SQLite.Result 0.)

Это мой код:

Код: Выделить всё

class SQLiteManager {
static let shared = SQLiteManager()
private var db: Connection?
private init() { // Initialize database connection
do {
let dbPath = "/Users/mrx/desktop/testdb.db"
db = try Connection(dbPath)
print("SQLite database path: (dbPath)")
} catch {
print("Error initializing SQLite database: \(error.localizedDescription)")
}
}
I have given all the permissions to all users on my machine using chmod for the db file, is there something else I need to do on Xcode?
I was thinking it must be a permission issue, but doesn't seem like it. It work's fine when I open the connection for database on the device (iPhone). but when I try to connectto local database, it throws error.


Источник: https://stackoverflow.com/questions/781 ... ome-folder

Вернуться в «IOS»