我尝试访问但使用此方法却收到错误消息“找不到这样的表”
let path = try! FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false).appendingPathComponent("NewFile.db")
let database = FMDatabase(path: path.path)
if !database.open() {
print("Unable to open database")
return
}
if let rs = database.executeQuery(" SELECT * FROM myowntable", withArgumentsIn: []) {
while rs.next() {
//...
}
} else {
print("executeQuery failed: \(database.lastErrorMessage())")
}
database.close()