Fredrik
Fredrik

Reputation: 1312

Xcode SQLite - no such table

I have a database located in the Resource folder. This is how I open the database:


NSString* path = [[NSBundle mainBundle] pathForResource:@"dotdDB" ofType:@"sqlite"];
if (sqlite3_open(path, &_database) != SQLITE_OK) {

I know that sqlite3_open command creates a new database if it can't find it so that's why I get "no such table"

I've tried to uninstall the app and reset the simulator but still no success. Any suggestions why I can't find my database in the simulator?

*I use Xcode 3 & sqlite3

Upvotes: 1

Views: 3092

Answers (2)

Ushox
Ushox

Reputation: 758

I can recommend using fmdb library to interact with sqlite. IMHO, it makes the db operations pretty painless.

Upvotes: 0

user478681
user478681

Reputation: 8329

Try this:

sqlite3_open([path UTF8String], &_database)

Upvotes: 3

Related Questions