我以以下格式存储数据
05/03/2012 10:11PM : <0818aaaa aaaaaaaa aaaa454d 554c4154 4f520000 00000000 0000>
但是当检索数据时,我使用以下方法
sqlite3 *database;
if(sqlite3_open([dbPath UTF8String], &database) == SQLITE_OK) {
// Setup the SQL Statement and compile it for faster access
const char *sqlStatement = "select logText from logTable";
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(database, sqlStatement, -1, &compiledStatement, NULL) == SQLITE_OK) {
while(sqlite3_step(compiledStatement) == SQLITE_ROW) {
NSString *addressField = [[NSString alloc] initWithUTF8String:(const char *) sqlite3_column_text(compiledStatement, 0)];
// Read the data from the result row
fullLog=[NSString stringWithFormat:@"%@%@",fullLog,addressField];
} // end of the while
}
sqlite3_finalize(compiledStatement);
}
sqlite3_close(database);
我收到以下错误,
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithUTF8String:]: NULL cString'
*在第一次抛出时调用堆栈:
请帮助为什么会出现这个问题