What's new

How i do execute sqlite in iphone?

jgm ios

New Member
Joined
Sep 27, 2019
Messages
2
Reaction score
0
I have the following problem. An application that has a sqlite database. I run the application in xcode, with the simulator. I have the following code to know where I have to put the database.

sqlite3 *bd;

NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
NSUserDomainMask, YES);
NSString *documentsDir = [paths objectAtIndex:0];

NSString *dbPath = [documentsDir stringByAppendingPathComponent:mad:"bd.sqlite"];

NSLog(@"bd route ---- %@",dbPath);


So I get the path, and copy the sqlite database, so the application works perfectly in xcode. The problem is when I connect my iphone and try to run the application. Because the previous code gives me a route on the iphone, and I try to put the sqlite database there but it does not run, the application is blocked because it cannot find the database, even if I put it there. I don't know if what I am doing is correct or there is another way to do it. I'm going crazy looking for possible solutions on the internet, but none works for me and I've been standing for 3 months trying to run the application on the iphone. Please, some help or advice, I would appreciate it. Many thanks.
 
wehre is this forum?
I'm new to this and I don't have much idea
 
Top