Tip of the Day for Xcode and Sqlite

This is one of the simplest but could also be the toughest to crack.

Imagine this, you wrote most of the Database class for your new application . At the same time you have created your database schema, and save a copy of the file (.sqlite) in where your project folder is.

You tried running the codes but it seems that there’s a error with the file not found.

To resolve this simply add the Application.sqlite file to your xcode project.

Then make sure that under Targets-> Build Phases -> Copy Bundle Resources,  you have your Application.sqlite in there.

To really confirm again, when you have ran your simulator once, you can browse to the following path,

/Users/<yourname>/Library/Application Support/iPhone Simulator/5.0/Applications/<GUID>/<ApplicationName>.app

Right Click on the file and show content.

Happy Coding!