mercredi 20 mai 2015

FMDatabase - Use of unresolved identifier 'FMDatabase'

I'm rewriting an App purely in Swift. Just starting on the Database for which I use FMDB. I took some same code out of the "iOS8 App Development Essentials". When I compile the line:

let locationsDB = FMDatabase(path: databasePath as String)

It gives me a Use of Unresolved Identifier "FMDatabase" error. This part of the code reads:

let filemgr = NSFileManager.defaultManager()
        let dirPaths = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)
        let docsDir = dirPaths[0] as! String
        databasePath = docsDir.stringByAppendingPathComponent("locations.db")

        if !filemgr.fileExistsAtPath(databasePath as String) {
            let locationsDB = FMDatabase(path: databasePath as String)

            etc...

Any ideas?

Aucun commentaire:

Enregistrer un commentaire