I\'ve set up swift project to use sqlite. sometimes, when inserting it doesn\'t actually insert the correct (or all) the values. I know because I restart the app, and when
I had the same problem. I found the way to resolve this problem.
sqlite3_bind_text(statement, 1, itemName, -1, nil) --> itemName should be UTF8 String
You should convert itemName as NSString and use UTF8String to convert your string to UTF8. Right code is the same here
let itemName = item.itemName as NSString
sqlite3_bind_text(statement, 1, itemName.UTF8String, -1, nil)
Good luck.