Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sqlite connection with Objective C

I have a simple piece of code where I connect my sqliteDb. My sqlite3_prepare_v2 though repeatedly fails. I narrowed it down to the following piece of code:

NSString *sqLiteDb = [[NSBundle mainBundle] pathForResource:@"xyz" ofType:@"sqlite3"];

sqLiteDb returns null. I don't know why - tried everything I could and followed many threads. Really struggling here - please help.

like image 541
sr1972 Avatar asked Aug 27 '26 15:08

sr1972


1 Answers

Are you sure your xyz.sqlite3 file is included in the correct Target Membership? If it is not included, then it will not be copied to your bundle when building.

Screenshot

like image 189
dreamlax Avatar answered Aug 29 '26 17:08

dreamlax