sqlite에서 데이터를 검색하려고합니다. 불행히도 테이블은 null 값으로 채워집니다. 콘솔에 FIRST ID RECUPERÉ : (null)
이 표시됩니다. 당신의 의견을 좀주세요. tableauMsgReceived
가 nil
경우 NSLog
문이 코드 주어진 결과입니다 줄 것이다sqlite에서 데이터 가져 오기
NSString * statementID = [NSString stringWithFormat:@"SELECT id_message FROM messages;"];
const char * sql_stmt_id = [statementID UTF8String];
sqlite3_stmt *compiledStatement;
if(sqlite3_prepare_v2(contactDB, sql_stmt_id, -1, &compiledStatement, NULL) == SQLITE_OK)
{
[tableauMsgReceived removeAllObjects];
while(sqlite3_step(compiledStatement) == SQLITE_ROW)
{
[tableauMsgReceived addObject:[NSString stringWithFormat:@"%s",(char *) sqlite3_column_text(compiledStatement, 0)]];
NSLog(@"First ID : %@", [tableauMsgReceived objectAtIndex:0]);
}
}
sqlite3_finalize(compiledStatement);
}
sqlite3_close(contactDB);
실행중인 SQL 문은 무엇입니까? 첫번째 신분증의 NSLog가 널을 출력한다고 말하는 겁니까? –
자세한 내용을 입력해야합니다. 이 코드를 실행하면 실제로 어떻게됩니까? – rmaddy
우리에게 sql_stmt_id를 보여주십시오. –