Update Query using the Objective C Wrapper for sqlite

Posted by user271753 on Stack Overflow See other posts from Stack Overflow or by user271753
Published on 2010-04-23T10:49:30Z Indexed on 2010/04/23 10:53 UTC
Read the original article Hit count: 699

Hey I am using the http://th30z.netsons.org/2008/11/objective-c-sqlite-wrapper/ wrapper .

My code is this :

    - (IBAction)UpdateButtonPressed:(id)sender 
    {


        Sqlite *sqlite = [[Sqlite alloc] init];
        NSString *writableDBPath = [[NSBundle mainBundle]pathForResource:@"Money"ofType:@"sqlite"];
        if (![sqlite open:writableDBPath])
            return;


        NSArray *query = [sqlite executeQuery:@"UPDATE UserAccess SET Answer ='Positano';"];
            NSDictionary *dict = [query objectAtIndex:2];
            NSString *itemValue = [dict objectForKey:@"Answer"];
            NSLog(@"%@",itemValue);
}

Answer is the Column name , UserAccess the table name . the column is at 3rd place in the table

What am I doing wrong why is it crashing ???

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about wrapper