sqlite3 *database;
if (sqlite3_open([[self dataFilePath] UTF8String], &database)
!= SQLITE_OK) {
sqlite3_close(database);
NSAssert(0, @"Failed to open database");
}
NSString *query = @"SELECT Index, Title, Year FROM Pack01";
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, [query UTF8String],-1, &statement, nil) == SQLITE_OK) {
while (sqlite3_step(statement) == SQLITE_ROW) {
title = [[NSString alloc]initWithUTF8String:(const char *) sqlite3_column_text(statement, 1)];
labelDisplay.text = myTitle;
if (sqlite3_open([[self dataFilePath] UTF8String], &database)
!= SQLITE_OK) {
sqlite3_close(database);
NSAssert(0, @"Failed to open database");
}
NSString *query = @"SELECT Index, Title, Year FROM Pack01";
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, [query UTF8String],-1, &statement, nil) == SQLITE_OK) {
while (sqlite3_step(statement) == SQLITE_ROW) {
title = [[NSString alloc]initWithUTF8String:(const char *) sqlite3_column_text(statement, 1)];
labelDisplay.text = myTitle;