There is no function as sqlite3_column_date
which I need:
int i = 0;
for (NSString *key in [self valuesWithTypes]) {
id value;
if ([[[self valuesWithTypes] objectForKey:key] isKindOfClass:[NSString class]]) {
value = [[NSString stringWithUTF8String:(char *)sqlite3_column_text(statement, i)] autorelease];
}
else if ([[[self valuesWithTypes] objectForKey:key] isKindOfClass:[NSNumber class]]) {
value = [[NSNumber numberWithDouble:sqlite3_column_double(statement, i)] autorelease];
}
else if ([[[self valuesWithTypes] objectForKey:key] isKindOfClass:[NSDate class]]) {
// value = // WTF
}
else if ([[[self valuesWithTypes] objectForKey:key] isKindOfClass:[NSData class]]) {
value = [[NSData dataWithBytes:sqlite3_column_blob(statement, i) length:sqlite3_column_bytes(statement, i)] autorelease];
}
[rowDictionary setValue:value forKey:key];
i++;
}
SQLite3 tables can have a date/datetime typed column. But how, in the name of the holy Lord, can I get a date column out of a row?
Thanks