To get the path to the file you added to Xcode, you should use pathForResource: ofType: with your mainBundle.
NSString *path = [[NSBundle mainBundle] pathForResource:@"yourDb" ofType:@"sqlite"];
But you cannot modify files in mainBundle. Therefore, you need to copy it to another place. For example, in the library of your application.
You can do it as follows:
NSString *libraryPath = [NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES) lastObject]; NSString *targetPath = [libraryPath stringByAppendingPathComponent:@"yourDB.sqlite"]; if (![[NSFileManager defaultManager] fileExistsAtPath:targetPath]) {
source share