我正在尝试使用以下代码访问我的 SQLite 中的表:
fileMgr = [NSFileManager defaultManager];
NSString *dbPath = [[[NSBundle mainBundle] resourcePath ]stringByAppendingPathComponent:@"movieData.sqlite"];
if(sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK){
const char *sql = "SELECT movieName FROM myMovies";
sqlite3_stmt *sqlStatement;
if(sqlite3_prepare(db, sql, -1, &sqlStatement, NULL) != SQLITE_OK)
{
NSLog(@"Problem with prepare statement");
}
我的输出是“准备语句的问题”。我很确定我的表名和 *sql 中的其他内容。但还是不行。有什么想法吗?