我对 SQLite 和 iOS 完全陌生。我正在学习有关如何在 iOS 中使用 SQLite 的基本教程:
http://www.switchonthecode.com/tutorials/using-sqlite-on-the-iphone#comment-11617
在上面的链接中,他们将数据库指定为:
sqlite3 *database;
int result = sqlite3_open("/myExampleDatabase.db", &database);
但是当我使用上面的代码替换我的数据库名称时,我得到了一个错误,如随后的 alertview 中所指定的。
我的问题是,我是否必须将数据库文件添加到我的资源文件夹中?如果不是,我是否必须将我的数据库文件放在 iOS 可以访问的地方?
最佳答案
我建议对 SQLite 使用 FMDB 包装器: https://github.com/ccgus/fmdb
关于ios - 无法在 iOS 中连接 SQLite 数据库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11664043/