Sqlite database crash

Recently I set up a SQLite database for an iPhone application using this great little browser.

Reading from the database was fine (using System.Data.Sqlite.Dll is a breeze), but every time I tried to write to the database it was crashing the app. After much debuging & un/commenting of code I finally remembered that the directory of the main application bundle is read-only, and that is where I had the database! Thus on first run after installation, I now copy the blank database to the “Documents” directory and use it from there.

It was a silly mistake but I hope this helps others, because the MonoTouch framework was not throwing an exception, and when the app just crashes on you it’s difficult to determine what’s going wrong.

Advertisements

Tags: , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: