Skip to content

Instantly share code, notes, and snippets.

-(NSArray*) openDatabaseWithSql:(NSString*)statement {
// Open the database. The database was prepared outside the application.
if (sqlite3_open([self.dbPath UTF8String], &database) == SQLITE_OK) {
// Get the primary key for all books.
const char *sql = [statement cStringUsingEncoding:NSUTF8StringEncoding];
sqlite3_stmt *statement;
// Preparing a statement compiles the SQL query into a byte-code program in the SQLite library.
// The third parameter is either the length of the SQL string or -1 to read up to the first null terminator.
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) == SQLITE_OK) {
-(void)checkAnswer:(int)answer {
if(rightAnswer==answer)
{
//AudioServicesPlaySystemSound(_tweetSound);
score++;
}
else {
//AudioServicesPlaySystemSound(_barkSound);
}
[self updateScore];