Ankit
Ankit

Reputation: 339

Working with SQLite in XCode

The application I made currently use XML files to store data and now want to Convert it to SQLite db as manipulating data in XML file is getting bit complicated.

I decided on FMDB to be used as Wrapper for SQL. The problem is, the development process right now is going pretty slow as I have to use NSLogs to print every SQLite command to verify if it is working or not. Is there a GUI Tool which can be used while development which shows me the changes in SQL table in real time as I am running the app on Simulator.

Upvotes: 0

Views: 430

Answers (1)

JMBise
JMBise

Reputation: 690

You can see in real time with sqlite3 in commande line, For GUI you have to reload the database's file to see the changes.
For get the location of your database's file use this code:

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,   NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];
NSLog("%@", documentsDir);
[pool release];

For managing your database with GUI you can load you database's file with http://menial.co.uk/software/base/
With Base program you have to click on "Reload button" after each change

Upvotes: 1

Related Questions