标签:ios数据库sqlite
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];
标签:ios数据库sqlite
原文地址:http://roderickkennedy.blog.51cto.com/6758427/1551959