Hello all,
I'm new to Objectiv-C and i try to get my database SQLite to work, but i get sommene trobble i hobe i can get sommen help here.
That i will have my code to doe its bind all "region_title" to tableview, and "region_id" to the id like "html" when you use "options"
i have try to search about it but i can't find help to my problem, i hob sombardy can help me here.
say if you need more code samples from me, you can recode this code if you think its better, right now i relly need to try this and get it to work. :0)
tanks a lot for all help from all.
const char *sql = "SELECT region_id, region_title FROM region";
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(database, sql, -1, &statement, NULL) == SQLITE_OK)
{
while (sqlite3_step(statement) == SQLITE_ROW)
{
NSString *aRegionId = [[NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 1)] autorelease];
NSString *aRegionTitle = [[NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, 2)] autorelease];
MapClass *mapclass = [[MapClass alloc] initWithName:aRegionTitle region_id:aRegionId];
[todoArray addObject:mapclass];
}
self.listData = todoArray;
}