每件事都在代码中,但不将数据保存在 SQLite db 中。有人可以帮忙吗?
在下面找到我的代码:
-(IBAction)signin:(id)sender{
NSLog(@"%@",perDas.string1);
nameString=[[NSString alloc]initWithString:perDas.string1];
statusString=[[NSString alloc]initWithFormat:@"IN"];
{
NSLog(@"passed");
sqlite3_stmt *statement;
const char *dbpath = [perDas.databasePath UTF8String];
if (sqlite3_open(dbpath, &database) == SQLITE_OK)
{
NSLog(@"pass");
NSString *insertSQL = [NSString stringWithFormat: @"INSERT INTO status VALUES (\"%@\", \"%@\", datetime(), \"%@\")", nameString, statusString,empString];
NSLog(@"%@",insertSQL);
const char *insert_stmt = [insertSQL UTF8String];
sqlite3_prepare_v2(database, insert_stmt, -1, &statement, NULL);
sqlite3_finalize(statement);
sqlite3_close(database);
}
}}
提前致谢