IOS SQLIte 数据库操作

时间:2014-09-14 02:37:36   收藏:0   阅读:275

NSString* docsDir = [NSSearchPathForDirectoriesInDomains (NSDocumentDirectory,NSUserDomainMask,YES) lastObject];

NSString* dbPath = [docsDir stringByAppendingPathComponent:@"people.db"];

FMDatebase* db = [FMDatebase databaseWithPath:dbPath];

FMResultSet* rs = [db executeQuery:@"select * from people"];

if(![db open])

{

return;

}

while ([rs next])

{

[rs stringForColumn:@"firstname"];

[rs stringForColumn:@"lastname"]

}

[db close];


原文:http://roderickkennedy.blog.51cto.com/6758427/1551959

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!