Apple 在 UILocalNotification
类引用中指定音频文件必须来自应用程序包。然而,一些聪明的极客通过使用找到了绕过这个限制的方法:
// this works by going up the bundle dir, then pointing to the Documents dir
localNotif.soundName = @"../Documents/blabla.caf";
此变通办法在 iOS 5 上运行良好,但在 iOS 6 中出现问题。为了尝试提出新的变通办法,我做了一个别名(符号链接(symbolic link)),名为blabla.caf
指向../Documents/blabla.caf
,并将其放入应用程序包中。这是我被卡住了。
现在,我遇到了一个PBXCp 错误
,Xcode 无法完成应用程序到设备的部署,因为显然
error: /Users/stuff/moreStuff/appName/../Documents/blabla.caf: No such file or directory
我的问题:
- 我可以通过某种方式向
Documents
目录添加一个虚拟文件 (0 KB) 来关闭 Xcode 吗? - 我能否以某种方式强制 Xcode 覆盖此错误并继续
life部署应用程序?
最佳答案
尽管从 bundle 到文档目录的符号链接(symbolic link)在 iOS 7.1 中有效,但如果您要将应用程序放入 AppStore,此变通方法将变得无用。自 2014 年 3 月以来,带有此类符号链接(symbolic link)的应用不会通过审核。
在我将 bundle 中带有此类链接的应用程序上传到 iTunes connect 后,我立即收到 Invalid binary
状态。来自 iTunes Store 的以下邮件:
Dear developer,
We have discovered one or more issues with your recent delivery for "X". To process your delivery, the following issues must be corrected:
Invalid Symlink - Your package contains a symbolic link 'External/Documents' which resolves to a location 'External/../../Documents' that does not exist or is outside of the package.
...
Regards,
The App Store team
关于ios - 在应用程序包中添加符号链接(symbolic link),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13399864/