Thanks a lot for your reply but now I get an exception
*** -[NSBundle pathForResource:extension:]: unrecognized selector sent to instance 0x50b1d0
2009-01-10 02:53:12.557 [37340:20b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSBundle pathForResource:extension:]: unrecognized selector sent to instance 0x50b1d0'
The way I was doing it before was like that
Code:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
/NSString *path = [documentsDirectory stringByAppendingPathComponent:@"hosam.sqlite"];
and the call to open the database is
Code:
if (sqlite3_open([path UTF8String], &database) == SQLITE_OK) {
hosam.sqlite is inside the resources folder as well as in the project folder