Objective c sqlite3\u列\u计数始终返回1
为什么此计数总是返回1Objective c sqlite3\u列\u计数始终返回1,objective-c,sqlite,Objective C,Sqlite,为什么此计数总是返回1 事实上,这个表有18条记录,你是说行,不是列,计数? 列计数(在您的案例标题中)实际上始终为1。它是1,因为您的语句仅选择sone列(标题)。试试这个,看看它会返回什么: sqlite3_stmt *statement; selectSql = "SELECT title FROM list"; sqlite3_prepare_v2(database, selectSql, -1, &statement, NULL); countColumn = sqlite3
事实上,这个表有18条记录,你是说行,不是列,计数?
列计数(在您的案例标题中)实际上始终为1。它是1,因为您的语句仅
选择sone列(标题
)。试试这个,看看它会返回什么:
sqlite3_stmt *statement;
selectSql = "SELECT title FROM list";
sqlite3_prepare_v2(database, selectSql, -1, &statement, NULL);
countColumn = sqlite3_column_count(statement);
NSLog(@"%d",countColumn);
@sunajledif NSLog(@“什么?!”)@不完全是Jake NSLog(@“%d”,countColumn),他正在记录专栏数,我的第一条评论中有一个问号,我想你没有注意到:)
sqlite3_stmt *statement;
selectSql = "SELECT * FROM list";
sqlite3_prepare_v2(database, selectSql, -1, &statement, NULL);
countColumn = sqlite3_column_count(statement);
NSLog(@"%d",countColumn);