码迷,mamicode.com
首页 > 移动开发 > 详细

IOS SQLIte 数据库操作

时间:2014-09-14 02:37:36      阅读:220      评论:0      收藏:0      [点我收藏+]

标签: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 数据库操作

标签:ios数据库sqlite

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!