问题描述
我是SQLite和iOS的新手。我正在学习如何在iOS中使用SQLite的基本教程:
I am completely new to SQLite and iOS. I am following a basic tutorial on how to use SQLite in iOS:
在上面的链接中,他们已将数据库指定为:
In the above link, they have specified the database as:
sqlite3 *database;
int result = sqlite3_open("/myExampleDatabase.db", &database);
但是当我使用上面的代码替换我的数据库名称时,我收到了一个错误,如随后的警报视图。
but when I use the above code with replacing my database name, I get an error as specified in the subsequent alertview.
我的问题是,我是否必须将数据库文件添加到资源文件夹中?如果没有,我是否必须将我的数据库文件放在iOS可以访问的地方?
My question here is, do I have to add the database file into my resource folder? If not, do I have to have my database file somewhere that is accessible to iOS?
推荐答案
我建议在SQLite中使用FMDB包装器:
I suggest using FMDB wrapper for SQLite:https://github.com/ccgus/fmdb
这篇关于无法在iOS中连接SQLite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!