I have this function:
func takeDatabase() -> FMDatabase {
let documentsFolder = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as! String
let path = documentsFolder.stringByAppendingPathComponent("test.sqlite")
let database = FMDatabase(path: path)
// println(path)
if !database.open() {
println("Unable to open database")
}
return database
}
I want to change the path, to be in main directory of my app. How can I do this? I try a lot, but with no results.
Thanks
Aucun commentaire:
Enregistrer un commentaire