Hi,
I'm wondering if someone can help me understand what is wrong with this block of code. I never get past the sqlite3_prepare_v2 statement and the debugger says :
'NSInternalInconsistencyException', reason: 'Error while creating add statement. 'out of memory''
static sqlite3 *database = nil;
sqlite3_stmt *addStmt = nil;
if(addStmt == nil) {
NSLog(@"About to add start time...\n");
const char *sql = "INSERT INTO games_played(start) VALUES(?)";
if(sqlite3_prepare_v2(database, sql, -1, &addStmt, NULL) != SQLITE_OK)
NSAssert1(0, @"Error while creating add statement. '%s'", sqlite3_errmsg(database));
NSLog(@"add statement created successfully!\n");
}
NSLog(@"About to bind start time...\n");
sqlite3_bind_text(addStmt, 1, @"start time", -1, SQLITE_TRANSIENT);