0
我有一個是包含在具有以下名稱捆綁文件:使用編譯器指令發出警告,如果文件丟失
databaseX.sqlite
其中X是應用程序的版本。如果版本爲2.8,則該文件應該命名爲database2.8.sqlite
。當應用程序提交給Apple時,我必須確保包含此文件。
是否有可能創建一個編譯器指令來檢查文件是否在包中?
我已經試過了,沒有成功
#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
總是顯示,即使該文件是不捆綁。
由於之前「歸順」的,這會是在編譯腳本中完成?當然,另一個可以刪除它。 – Larme
@Larme您可以在構建或構建後的腳本中執行任何操作。 – Sulthan
@Sulthan - 知道文件在提交之前就已經存在了...... – SpaceDog