Objective-c inserting data with iphone 4s -
I have created an app that uses IM to insert data with FMDB wrapper and consult with SQL database The data is displayed in a table view, the problem is that when I do everything right on an iphone 4, but when I do it on an iphone 4s, then this is not a problem. My code is part of:
Loading DB:
aPools = [[NSMutableArray alloc] init]; NSString * path = [[NSBundle main bundle] Pathfoser resource: @ "pool db" type: @ "sqlite"]; MainDB = [[FM Database Alok] InitVithpath: Path]; [Menadi's Open]; FMResultSet * fResult = [mainDB Execution: @ "selection * from pulse data]]; While ([FRSALT next]) {Puladata = [FRS fruit string fora column: @ "name"]; [APools addObject: pools data]; } [Close to main DD]; Saving:
- (zero) saveIntoDB: volume with name (NSString *): (float) volume type: (NSString *) type and DESC: (NSSTING *) Dell [[Menadi Open]; [MainDB executeUpdate: @ "pool, data (name, volume, type, dcc) values (" ,,,,,?) ", Name, [flotto with NSNumber number], type, description, zero] INSERT; [Main DD Close]; }
Could it be that the table view works in different ways? Try the following code:
For LOADING:
aPools = [[ NSMutableArray alloc] init]; NSString * path = [[NSBundle main bundle] Pathfoser resource: @ "pool db" type: @ "sqlite"]; FMDatabase * mainDB FMResultSet * fResult = [mainDB executeQuery: @ "SELECT * FROM pools data"]; While ([FMDbase databaseWith path: path]; if (! [MainDB open]] {return no; // after error in database opening}; while ([ [APRSLT Next]] {Puladata = [FRS fruit string fora column: @ "name"]; [APools addObject: pools data];} [main DD off]; code to save: - (zero) saveIntoDB: (NSString *) Volume with name: (float) Volume type: (NSString *) Type and DCC: (NSString *) Del {FMDatabase * mainDB = [FM Database DatabaseWith Path: Path] ; If (! [MainDB open]) {return; // Error since opening database since} [mainDB start Transaction]; [MainDB executeUpdate: @ "Include pool, data (name, quantity, type, DCC) values (?,?,?,?)", Name, [NSNumber number explosion: quantity], type, character]; [Chief DB Commit]; [Close main DD]; }
Comments
Post a Comment