vendredi 6 février 2015

sqlite3_prepare_v2 returns 1

For days I have a problem that is making me crazy.


I use the API swiftdata.swift on GitHub, link Here.


Well, if I launch my project on the iOS Simulator with Iphone6 it works beautifully, but if I use another iOS device the application crashes. I found that the error is due from instruction



func executeQuery(sqlStr: String, withArgs: [AnyObject]? = nil) -> (result: [SDRow], error: Int?) {
var resultSet = [SDRow]()
var sql = sqlStr
if let args = withArgs {
let result = bind(args, toSQL: sql)
if let err = result.error {
return (resultSet, err)
} else {
sql = result.string
}
}
var pStmt: COpaquePointer = nil
var status = sqlite3_prepare_v2(SQLiteDB.sharedInstance.sqliteDB, sql, -1, &pStmt, nil)
if status != SQLITE_OK {
println("SwiftData Error -> During: SQL Prepare")
println(" -> Code: \(status) - " + SDError.errorMessageFromCode(Int(status)))
if let errMsg = String.fromCString(sqlite3_errmsg(SQLiteDB.sharedInstance.sqliteDB)) {
println(" -> Details: \(errMsg)")
}
sqlite3_finalize(pStmt)
return (resultSet, Int(status))
}
.........


Why? I imported the library libsqlite3.0.dylib, I doubt that this library is related only for iPhone6. Can anyone help me?


I use Xcode 6.1


Thanks


Aucun commentaire:

Enregistrer un commentaire