我有一个包含 5 条记录的数据库,我需要使用计时器在屏幕上一一显示记录。时间间隔应为 30 秒。
- (NSMutableArray*) fnGetName
{
DBCon *oDBCon = [[DBCon alloc] init];
[oDBCon fnInitializeDB];
NSMutableArray *arrDict = [[NSMutableArray alloc] init];
NSString *sQryName = [NSString stringWithFormat:@"SELECT * FROM tbl_names"];
sqlite3_stmt *selectstmt;
if(sqlite3_prepare_v2(oDBCon.database, [sQryName UTF8String], -1, &selectstmt, NULL) == SQLITE_OK)
{
while(sqlite3_step(selectstmt) == SQLITE_ROW) {
oBlossom = [[Blossom alloc]initWithPrimaryKey:primaryKey database:oDBCon.database];
oBlossom.psName = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt,1)];
NSLog(@"oBlossom.psName %@", oBlossom.psName);
oBlossom.psKeyword = [NSString stringWithUTF8String:(char *)sqlite3_column_text(selectstmt,2)];
NSLog(@"oBlossom.psKeyword %@", oBlossom.psKeyword);
[arrDict addObject:oBlossom];
}