I am a beginner in swift language (for IOS) and I am going to use sqlite in my program. I added the libsqlit3.dylib to my project and used bridging-header. (the wrapper is downloadded from : https://github.com/chrismsimpson/SwiftSQLite) I have run the following code :

    var db = SQLiteDatabase();
    db.open("test.db");
    var statement = SQLiteStatement(database: db);
    var sql = "CREATE TABLE IF NOT EXISTS CONTACTS (ID INTEGER PRIMARY KEY AUTOINCREMENT, NAME TEXT, ADDRESS TEXT, PHONE TEXT)"

    println("result :  \(statement.prepare(sql))");

the result code is 21 which means "Library used incorrectly". the test.db file doesn't exist and expect it will be created.

I dont know what is the problem! please help me.

Related posts

Recent Viewed