I am facing problem in accessing database file when I am running it on device. How can I get that file? There is no problem in accessing file when I am running application o
As others have said your database should not be within your application's root folder. If you are loading a static database from your bundle (i.e a database preloaded by adding it in xCode) you have to access it by the bundle.
NSString *path = [[NSBundle mainBundle] pathForResource:@"mysqlite" ofType:@"sqlite"];
If you are accessing the file from the documents directory (i.e it has been modified or saved).
NSString *fileName = @"mysqlite.sqlite";
NSString *directoryPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *path = [directoryPath stringByAppendingPathComponent:fileName];