I am using an sql database. Works fine with the simulator but when I test on iPod Touch, the statement "if(sqlite3_prepare_v2(database, sql, -1, &compiledStatement, NULL) == SQLITE_OK)" is never true i.e. does not fine anything in the database.
The database file is initially in the bundle folder. You need to copy it to the documents folder if it doesn't exist there. Look at the SQLBooks example for 'copydatabaseifneeded'
The database file is initially in the bundle folder. You need to copy it to the documents folder if it doesn't exist there. Look at the SQLBooks example for 'copydatabaseifneeded'
I guess I missed that! However, surely if the db is not in the right place, the sqlite3_open would fail - it did not!
oh, it can fail easily, and if you don't implement your own checks it will happily open nonexisting databases and write to them. Been there, done that.
oh, it can fail easily, and if you don't implement your own checks it will happily open nonexisting databases and write to them. Been there, done that.
Well whatever... I did make the change - adding something along the lines of the "copydatabaseifneeded" code as you suggested, and, after cleaning up the iPod, it worked!!