mardi 24 novembre 2015

use NSURL email attachment to append to sqlite

Could anyone please be kind enough to give a bit of help,

I have been using "- (void)handleOpenURL:(NSURL *)openIn" method to import an emailed sqlite database to the app users, they then use the "open in" option to import the data, the problem I have is the emailed file is becoming too large so instead of overwriting the sqlite file, I would like to append the data to a local sqlite DB (the DB does have 4 tables)

dbRMNames = @"fieldnames.sql"; NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject]; NSError *writeError = nil; NSString *filePathx = [documentsPath stringByAppendingPathComponent:dbRMNames]; [dbimport writeToFile:filePathx atomically:YES]; NSLog(@"Import File Name: %@", dbRMNames); if (writeError) { NSLog(@"Error writing file: %@", writeError); }

Above is my currant method, I think I need to create a table in the ViewDIdLoad, just not sure how to save the NSDATA to the table

Any helpers?

Aucun commentaire:

Enregistrer un commentaire