I have a file that is included on the bundle that has the following name:
databaseX.sqlite
where X is the app's version. If the version is 2.8, the file should be named database2.8.sqlite
. I have to be sure to include this file when the app is submitted to Apple.
Is it possible to create a compiler directive to check if the file is in the bundle?
I have tried this, without success
#define fileInBundle [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"LoteriaMac%@.sqlite", [[NSBundle mainBundle] objectForInfoDictionaryKey: @"CFBundleShortVersionString"]]]
#if defined(fileInBundle)
#pragma message("file in bundle")
#else
#pragma message("file missing")
#endif
file in bundle
is always shown even if the file is not in bundle.