无法在iOS中连接SQLite数据库 [英] Unable to connect SQLite Database in iOS

查看:142
本文介绍了无法在iOS中连接SQLite数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是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:

http://www.switchonthecode.com/tutorials/using-sqlite-on-the-iphone#comment-11617

在上面的链接中,他们已将数据库指定为:

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包装器:
https://github.com/ccgus/fmdb

I suggest using FMDB wrapper for SQLite: https://github.com/ccgus/fmdb

这篇关于无法在iOS中连接SQLite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆