i wnant to fetch the data fromt the database but getting error when i try to get the empty column... i used the following code to do it.. NSString *aDescription = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)]; so if my second column is empty than i get exception
A:
Please put the condition to check the value:
NSString *aDescription = nil;
if((char *)sqlite3_column_text(compiledStatement, 2) != NULL)
{
aDescription = [NSString stringWithUTF8String:(char*)sqlite3_column_text(compiledStatement, 2)];
}
Now the it will not generate the exception.
Jim
2010-05-27 06:03:38
thank you for showing another approach
Jaimin
2010-05-27 13:28:06