我正在使用FMDB。我执行以下代码在FMDB中找不到主要标识
FMResultSet *results = [database executeQuery:@"select * from customer"];
while([results next])
{
Customer *customer = [[Customer alloc] init];
customer.customerId = [results intForColumn:@"id"];
customer.firstName = [results stringForColumn:@"firstname"];
customer.lastName = [results stringForColumn:@"lastname"];
[customers addObject:customer];
NSLog(@"%d", customer.customerId);
}
但我没有获取customerId值。我只想要自动递增的rowid。
请提出好的建议......
“客户”表的结构是什么? – Ilanchezhian 2012-02-06 09:07:46
你的表中是否有名称为“id”的字段? – Ilanchezhian 2012-02-06 09:09:48
不..没有id的字段。它只有名字和姓氏。但我想要自动创建并自动递增的rowid。 – Myaaoonn 2012-02-06 09:19:39