tags:

views:

43

answers:

1
    - (IBAction)SetupButtonPressed:(id)sender 
     {

Sqlite *sqlite = [[Sqlite alloc] init];
NSString *writableDBPath = [[NSBundle mainBundle]pathForResource:@"Money"ofType:@"sqlite"];
    if (![sqlite open:writableDBPath])
   return;
[sqlite executeNonQuery:@"CREATE TABLE test (key TEXT NOT NULL, num INTEGER, value TEXT);"];


 }

Hey guys the above code runs at first but the next time , the table does not exists in the database ! I am using http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/ what am I doing wrong ?

Or could you please suggest me a really simple tutorial for core data ?

+1  A: 

The application bundle is not writable on the iPhone, so you need to copy the database to a writable location in order to be able to make any changes to it.

Claus Broch